<p dir="ltr">Yes, sorry, thanks for looking.</p>
<p dir="ltr">Peter</p>
<div class="gmail_quote">On May 5, 2016 08:56, "Rafael Espíndola" <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I did, but it is easy to fix I think (working on it).<br>
<br>
Cheers,<br>
Rafael<br>
<div class="elided-text"><br>
<br>
On 5 May 2016 at 11:29, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
> On 5 May 2016 at 00:10, Peter Collingbourne via llvm-commits<br>
> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> Author: pcc<br>
>> Date: Wed May  4 23:10:12 2016<br>
>> New Revision: 268604<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=268604&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=268604&view=rev</a><br>
>> Log:<br>
>> ELF: Do not use -1 to mark pieces of merge sections as being tail merged.<br>
>><br>
>> We were previously using an output offset of -1 for both GC'd and tail<br>
>> merged pieces. We need to distinguish these two cases in order to filter<br>
>> GC'd symbols from the symbol table -- we were previously asserting when we<br>
>> asked for the VA of a symbol pointing into a dead piece, which would end<br>
>> up asking the tail merging string table for an offset even though we hadn't<br>
>> initialized it properly.<br>
>><br>
>> This patch fixes the bug by using an offset of -1 to exclusively mean GC'd<br>
>> pieces, using 0 for tail merges, and distinguishing the tail merge case from<br>
>> an offset of 0 by asking the output section whether it is tail merge.<br>
>><br>
>> Differential Revision: <a href="http://reviews.llvm.org/D19953" rel="noreferrer" target="_blank">http://reviews.llvm.org/D19953</a><br>
>><br>
>> Added:<br>
>>     lld/trunk/test/ELF/string-gc.s<br>
>> Modified:<br>
>>     lld/trunk/ELF/InputSection.cpp<br>
>>     lld/trunk/ELF/InputSection.h<br>
>>     lld/trunk/ELF/MarkLive.cpp<br>
>>     lld/trunk/ELF/OutputSections.cpp<br>
>>     lld/trunk/ELF/OutputSections.h<br>
>>     lld/trunk/ELF/Writer.cpp<br>
>><br>
>> Modified: lld/trunk/ELF/InputSection.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=268604&r1=268603&r2=268604&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=268604&r1=268603&r2=268604&view=diff</a><br>
>> ==============================================================================<br>
>> --- lld/trunk/ELF/InputSection.cpp (original)<br>
>> +++ lld/trunk/ELF/InputSection.cpp Wed May  4 23:10:12 2016<br>
>> @@ -419,7 +419,8 @@ MergeInputSection<ELFT>::MergeInputSecti<br>
>>    StringRef Data((const char *)D.data(), D.size());<br>
>>    std::vector<std::pair<uintX_t, uintX_t>> &Offsets = this->Offsets;<br>
>><br>
>> -  uintX_t V = Config->GcSections ? -1 : 0;<br>
>> +  uintX_t V = Config->GcSections ? MergeInputSection<ELFT>::PieceDead<br>
>> +                                 : MergeInputSection<ELFT>::PieceLive;<br>
>>    if (Header->sh_flags & SHF_STRINGS) {<br>
>>      uintX_t Offset = 0;<br>
>>      while (!Data.empty()) {<br>
>> @@ -478,15 +479,15 @@ typename ELFT::uint MergeInputSection<EL<br>
>>    // Compute the Addend and if the Base is cached, return.<br>
>>    uintX_t Addend = Offset - Start;<br>
>>    uintX_t &Base = I->second;<br>
>> -  if (Base != uintX_t(-1))<br>
>> +  auto *MOS = static_cast<MergeOutputSection<ELFT> *>(this->OutSec);<br>
>> +  if (!MOS->shouldTailMerge())<br>
>>      return Base + Addend;<br>
><br>
> This disabled the caching, no?<br>
><br>
> Cheers,<br>
> Rafael<br>
</div></blockquote></div>