[lld] r246902 - [elf2] Add 32S and 64 relocations (needed for musl).
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 20:06:40 PDT 2015
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
>
> Let's try to not have two different methods of testing -- it's gonna
> lead to headaches. I'm biased because I prefer assembler for testing,
> but given we started with that -- let's just stick to it.
>
I just checked. COFF tests for relocations with yaml2obj. If we want to use
llvm-mc to tests for relocations we should update COFF too.
-- Sean Silva
>
> > Added:
> > lld/trunk/test/elf2/relocations.test
> > Modified:
> > lld/trunk/ELF/Writer.cpp
> >
> > Modified: lld/trunk/ELF/Writer.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=246902&r1=246901&r2=246902&view=diff
> >
> ==============================================================================
> > --- lld/trunk/ELF/Writer.cpp (original)
> > +++ lld/trunk/ELF/Writer.cpp Fri Sep 4 19:36:03 2015
> > @@ -271,8 +271,12 @@ template <class ELFT> void OutputSection
> > SymVA + (RI.r_addend - (P +
> Offset)));
> > break;
> > case llvm::ELF::R_X86_64_32:
> > + case llvm::ELF::R_X86_64_32S:
> > support::endian::write32le(Location, SymVA + RI.r_addend);
> > break;
>
> Shouldn't we take care of sign extension somehow?
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150908/b88d8921/attachment.html>
More information about the llvm-commits
mailing list