<div dir="ltr">Why this is MIPS-specific issue? Do you mean MIPS is the only architecture that uses both REL and RELA?</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 27, 2016 at 1:32 PM, Simon Atanasyan <span dir="ltr"><<a href="mailto:simon@atanasyan.com" target="_blank">simon@atanasyan.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You are right. LLD does not have this problem. Initially I bumped into<br>
the MIPS specific bug related to GP relative relocations calculation.<br>
I tried to make reproduction script as general as possible and<br>
mistakenly make it too general. So now with your help I realized that<br>
the problem solely affects MIPS.<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Sep 27, 2016 at 8:46 PM, Peter Smith <<a href="mailto:peter.smith@linaro.org">peter.smith@linaro.org</a>> wrote:<br>
> Hello Simon,<br>
><br>
> Can I just check something with you? When I tried the example the<br>
> .data section symbols given in the llvm-readelf -r output are<br>
> different, one has an offset of 0 and one has an offset of 4 so the<br>
> addends don't need updating. In ld the section symbols both have the<br>
> same offset of 0 so the addends need updating. So I think the two<br>
> approaches are equivalent.<br>
><br>
> Have I misunderstood?<br>
><br>
> Peter<br>
><br>
> On 27 September 2016 at 08:28, Simon Atanasyan via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> Hi,<br>
>><br>
>> Now in case of relocatable object generation LLD merges and copies<br>
>> REL/RELA sections as is and does not touch any addends. But it is<br>
>> incorrect. If we have a relocation which targets a section, we have to<br>
>> adjust the relocation's addend to take in account that the section<br>
>> might be merged with other ones.<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Simon Atanasyan<br>
</font></span></blockquote></div><br></div>