[llvm-dev] [lld][ELF] Addends adjustment for relocatable object
Rui Ueyama via llvm-dev
llvm-dev at lists.llvm.org
Wed Sep 28 13:41:57 PDT 2016
Why this is MIPS-specific issue? Do you mean MIPS is the only architecture
that uses both REL and RELA?
On Tue, Sep 27, 2016 at 1:32 PM, Simon Atanasyan <simon at atanasyan.com>
> You are right. LLD does not have this problem. Initially I bumped into
> the MIPS specific bug related to GP relative relocations calculation.
> I tried to make reproduction script as general as possible and
> mistakenly make it too general. So now with your help I realized that
> the problem solely affects MIPS.
> On Tue, Sep 27, 2016 at 8:46 PM, Peter Smith <peter.smith at linaro.org>
> > Hello Simon,
> > Can I just check something with you? When I tried the example the
> > .data section symbols given in the llvm-readelf -r output are
> > different, one has an offset of 0 and one has an offset of 4 so the
> > addends don't need updating. In ld the section symbols both have the
> > same offset of 0 so the addends need updating. So I think the two
> > approaches are equivalent.
> > Have I misunderstood?
> > Peter
> > On 27 September 2016 at 08:28, Simon Atanasyan via llvm-dev
> > <llvm-dev at lists.llvm.org> wrote:
> >> Hi,
> >> Now in case of relocatable object generation LLD merges and copies
> >> REL/RELA sections as is and does not touch any addends. But it is
> >> incorrect. If we have a relocation which targets a section, we have to
> >> adjust the relocation's addend to take in account that the section
> >> might be merged with other ones.
> Simon Atanasyan
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev