<div dir="ltr">Hi Daniel,<div><br></div><div>Thanks very much - I really appreciate you tracking this down. David - once Daniel's patch goes in it would be interesting to see what impact his work has had on PPC. I expect this will fix some of the tests there too.</div><div><br></div><div>Regarding the AArch64 stub-addr return: My read is that createStubFunction returns a pointer to the start of the stub for AArch64. Those switch cases are a bit inconsistent though: What address they return depends on what the caller (relocation logic) wants to do to fix up the stub. That could be modifying operands in the stub, or it could be tagging an extra absolute address field after the stub. Hopefully we can start to clean this stuff up as we move to a RuntimeDyld-class-per-target setup.</div><div><br></div><div>Cheers,</div><div>Lang.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 4, 2014 at 8:23 AM, Daniel Sanders <span dir="ltr"><<a href="mailto:Daniel.Sanders@imgtec.com" target="_blank">Daniel.Sanders@imgtec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal">I've found it. Host-endianness isn't accounted for when emitting the instructions in the ARM, AArch64, and Mips paths of RuntimeDyldImpl::createStubFunction(). I'll submit a patch for this soon. I'm not sure if PowerPC is affected or not.
 It uses big-endian order for ppc64_le which sounds odd but it also specifies the byte order which suggests it could be correct.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Also, I noticed that the AArch64 path is the only one that returns a pointer to the end of the stub function rather than the start. Is that correct?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>
 [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>Daniel Sanders<br>
<b>Sent:</b> 04 November 2014 15:47<br>
<b>To:</b> <a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a><br>
<b>Cc:</b> LLVM Developers Mailing List (<a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a>)<br>
<b>Subject:</b> [LLVMdev] Remaining big-endian host issues in RuntimeDyld<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hi Lang,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks for your help at the Hackers Lab. Fixing the problems we identified in RuntimeDyldMachOARM.h improves the MachO_ARM_PIC_relocations.s test quite a lot but there's one failed check that's proving a bit stubborn:<u></u><u></u></p>
<p class="MsoNormal">                Expression '*{4}(stub_addr(foo.o, __text, baz)) = 0xe51ff004' is false: 0x4f01fe5 != 0xe51ff004<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I'm struggling to find the cause of this mismatch at the moment. Do you have any idea suggestions on where to look?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="text-align:justify"><b><span style="font-size:12.0pt;font-family:"Arial","sans-serif";color:#3333ff">Daniel Sanders<u></u><u></u></span></b></p>
<p class="MsoNormal" style="text-align:justify"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#3333ff">Leading Software Design Engineer, MIPS Processor IP<u></u><u></u></span></p>
<p class="MsoNormal" style="text-align:justify"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#3333ff">Imagination Technologies Limited<u></u><u></u></span></p>
<p class="MsoNormal" style="text-align:justify"><a href="http://www.imgtec.com/" target="_blank"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">www.imgtec.com</span></a><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>
</div>

</blockquote></div><br></div>