[LLVMdev] Implementing the hotpatch attribute for X86

Michael Spencer bigcheesegs at gmail.com
Tue Oct 26 16:24:27 PDT 2010


On Tue, Oct 26, 2010 at 7:02 PM, Charles Davis <cdavis at mymail.mines.edu> wrote:
> Hi,
>
> According to
> http://blogs.msdn.com/b/freik/archive/2006/03/07/x64-hotpatchability.aspx,
> '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?
>
> Chip


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 llvm-dev mailing list