<div dir="ltr"><div>Hmm. Odd. I just rebuilt from scratch and it seems to work with the test/CodeGen/X86/xray-attribute-instrumentation.ll test case outputing straight to obj:</div><div><br></div><div>   llc -filetype=obj -o ~/a.o -mtriple=x86_64-apple-macosx < test/CodeGen/X86/xray-attribute-instrumentation.ll</div><div><br></div><div>What test case are you using? </div><div><br></div><div>In any case, the issue appears to be that llvm doesn't realize that the target address is resolved and erroneously applies branch relaxation to the jump. I don't know why a linker private symbol would make a difference. </div><div><br></div><div>-Nirav</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 22, 2016 at 12:14 PM, Dean Michael Berris <span dir="ltr"><<a href="mailto:dberris@google.com" target="_blank">dberris@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div dir="ltr">On Wed, Jun 22, 2016 at 6:05 AM Nirav Davé <<a href="mailto:niravd@google.com" target="_blank">niravd@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>This appears to work: </div><div><br></div>auto Target = OutContext.createLinkerPrivateTempSymbol();<div><br></div><div>with </div><div><br></div><div><div>auto Target = OutContext.createTempSymbol();</div></div><div><br></div><div>-Nirav<br></div><div><br></div></div></blockquote><div><br></div></span><div>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.</div><div><br></div><div>If I disassemble with llvm-objdump though I see the following:</div><div><br></div><div><div>_Z3foov:</div><div>  400c10:       e9 09 00 00 00  jmp     9 <_Z3foov+0xE></div><div>  400c15:       66 0f 1f 84 00 00 02 00 00      nopw    512(%rax,%rax)</div></div><div><br></div><div>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).</div><div><br></div><div>Is there anything else I can try here?</div><div><br></div><div>Thanks in advance!</div></div></div>
</blockquote></div><br></div>