This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add support for the Win32 hook prologue (try 3)


On Friday 11 September 2009 18:59:05, Richard Henderson wrote:
> I'd have thought that ".align 4, 0x90" would do the job, but the 
> assembler is being too clever and optimizing the sequence into a single 
> 3 byte nop. ?I had thought that using an explicit value here would use 
> the explicit value, but it turns out the only way to disable this, at 
> present, is to add "-n" to the assembler command line.
> 

For completeness, if the bit that I pasted in the other email
is allowed:

> "Googling hits this: <http://www.openrce.org/articles/full_view/22>, which
> mentions something about ">= 5 bytes, padded with 0xCC".

... then this variant does work: ".align 4, 0xcc".  The assembler isn't
going to be merging int3's for sure.  :-)

(disclaimer, I didn't actually read that page, just skimmed through it
for a few seconds.)

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]