[llvm-dev] x86: How to Force 2-byte `jmp` instruction in lowering

Dean Michael Berris via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 22 09:14:14 PDT 2016


On Wed, Jun 22, 2016 at 6:05 AM Nirav Davé <niravd at google.com> wrote:

> This appears to work:
>
> auto Target = OutContext.createLinkerPrivateTempSymbol();
>
> with
>
> auto Target = OutContext.createTempSymbol();
>
> -Nirav
>
>
Thanks Nirav -- I tried this but I'm still getting a "jmpq <address>" with
this incantation when I load and disassemble from gdb. I'm seeing a
5-instruction jump, followed by the nops.

If I disassemble with llvm-objdump though I see the following:

_Z3foov:
  400c10:       e9 09 00 00 00  jmp     9 <_Z3foov+0xE>
  400c15:       66 0f 1f 84 00 00 02 00 00      nopw    512(%rax,%rax)

I'm not sure whether the extra 0's after '0xe9 0x09' are alignment padding
(though I was expecing 0x90 to show up if this was an alignment issue).

Is there anything else I can try here?

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160622/8aa6fd99/attachment.html>


More information about the llvm-dev mailing list