<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 11, 2015 at 3:13 PM, Davide Italiano <span dir="ltr"><<a href="mailto:davide@freebsd.org" target="_blank">davide@freebsd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Sep 8, 2015 at 8:00 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, Sep 4, 2015 at 5:46 PM, Davide Italiano via llvm-commits<br>
> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> On Fri, Sep 4, 2015 at 5:36 PM, Michael J. Spencer via llvm-commits<br>
>> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> > Author: mspencer<br>
>> > Date: Fri Sep  4 19:36:03 2015<br>
>> > New Revision: 246902<br>
>> ><br>
>> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=246902&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=246902&view=rev</a><br>
>> > Log:<br>
>> > [elf2] Add 32S and 64 relocations (needed for musl).<br>
>> ><br>
>> > It wasn't obvious what the assembly was to generate these relocations,<br>
>> > so I did the test with yaml.<br>
>> ><br>
>><br>
>> It is actually obvious.<br>
>> Example 32S:<br>
>><br>
>> .text<br>
>> blah:<br>
>>   movl $blah, %rdx<br>
><br>
><br>
> Wouldn't this generate R_X86_64_32 instead?<br>
><br>
<br>
</span>No, it's invalid ASM I think (there's a typo).</blockquote><div><br></div><div>I was assuming you meant %edx, my bad.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> movl can't have a<br>
64-bit register as second operand. The correct example is movq $blah,<br>
%rdx.<br>
<br>
 % ./llvm-readobj -r ./blah<br>
<br>
File: ./blah<br>
Format: ELF64-x86-64<br>
Arch: x86_64<br>
AddressSize: 64bit<br>
LoadName:<br>
Relocations [<br>
  Section (3) .rela.text {<br>
    0x3 R_X86_64_32S .text 0x0<br>
  }<br>
]<br>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">This thread makes me think that if we are going to use asm to generate inputs for relocation tests, then at the very least one we need to add extra RUN lines to check that the asm in fact generates the relocation that is supposedly being tested.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Sean Silva</div><div class="gmail_extra"><br></div></div>