[lld] r246902 - [elf2] Add 32S and 64 relocations (needed for musl).

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 18:02:47 PDT 2015


On Fri, Sep 11, 2015 at 3:13 PM, Davide Italiano <davide at freebsd.org> wrote:

> On Tue, Sep 8, 2015 at 8:00 PM, Sean Silva <chisophugis at gmail.com> wrote:
> >
> >
> > On Fri, Sep 4, 2015 at 5:46 PM, Davide Italiano via llvm-commits
> > <llvm-commits at lists.llvm.org> wrote:
> >>
> >> On Fri, Sep 4, 2015 at 5:36 PM, Michael J. Spencer via llvm-commits
> >> <llvm-commits at lists.llvm.org> wrote:
> >> > Author: mspencer
> >> > Date: Fri Sep  4 19:36:03 2015
> >> > New Revision: 246902
> >> >
> >> > URL: http://llvm.org/viewvc/llvm-project?rev=246902&view=rev
> >> > Log:
> >> > [elf2] Add 32S and 64 relocations (needed for musl).
> >> >
> >> > It wasn't obvious what the assembly was to generate these relocations,
> >> > so I did the test with yaml.
> >> >
> >>
> >> It is actually obvious.
> >> Example 32S:
> >>
> >> .text
> >> blah:
> >>   movl $blah, %rdx
> >
> >
> > Wouldn't this generate R_X86_64_32 instead?
> >
>
> No, it's invalid ASM I think (there's a typo).


I was assuming you meant %edx, my bad.


> movl can't have a
> 64-bit register as second operand. The correct example is movq $blah,
> %rdx.
>
>  % ./llvm-readobj -r ./blah
>
> File: ./blah
> Format: ELF64-x86-64
> Arch: x86_64
> AddressSize: 64bit
> LoadName:
> Relocations [
>   Section (3) .rela.text {
>     0x3 R_X86_64_32S .text 0x0
>   }
> ]
>

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.

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150911/78ecb1b5/attachment.html>


More information about the llvm-commits mailing list