<div dir="ltr">I'm doing so, because I have to filter out duplicate input sections in createInputSectionList() function. Otherwise GoesAfter field may<div>point to non-existent input section object. The simplest case when we can have duplicate input sections is:</div><div><br></div><div>.foo :  {</div><div>   file1.o(.foo)</div><div>   *(.foo)</div><div>}</div><div><br></div><div>See linkerscript-input-sec-dup.s for a test case</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-30 16:53 GMT+03:00 Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 30 August 2016 at 09:10, Eugene Leviant <<a href="mailto:evgeny.leviant@gmail.com">evgeny.leviant@gmail.com</a>> wrote:<br>
> evgeny777 added a comment.<br>
><br>
> Yeah. See lines 294-295 in LinkerScript.cpp. Also, please take a look at linkerscript-symbols-<wbr>synthetic.s<br>
<br>
</span>Yes, I missed that the lambda was updating the outer Off variable.<br>
<br>
This is definitely an improvement. I guess my only remaining question<br>
is why do you need to set OutSec to -1?<br>
<br>
I think it might be possible to simplify things further by assigning<br>
offsets earlier, but that can be an independent patch.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>