[LLVMdev] Implementing the hotpatch attribute for X86
bigcheesegs at gmail.com
Tue Oct 26 18:24:27 CDT 2010
On Tue, Oct 26, 2010 at 7:02 PM, Charles Davis <cdavis at mymail.mines.edu> wrote:
> According to
> 'hotpatchable' functions on x86 (and by extension, x86-64) are preceded
> by six bytes of padding and start with a two byte instruction. The
> problem is that, still being relatively unfamiliar with the x86 backend,
> I have no idea how to implement this for the 'hotpatch' attribute I just
> added. I do remember the emitPrologue() method from when I was working
> on the alignstack() attribute, but I still don't know how to implement
> the first part (the six bytes of padding). Does anyone have any pointers?
The linker adds the padding. Also, the first instruction just has to
be two bytes or longer. Not exactly two bytes.
- Michael Spencer
More information about the LLVMdev