<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 7:35 AM, George Rimar via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">>So, in the context of this change, I think the most important<br>
>performance cases are<br>
><br>
>* Linker script is not used<br>
>* Linker script without KEEP<br>
>* Linker script with KEEP<br>
><br>
</span>I>f I read it correctly, the first case should not change much since<br>
<span class="">>Sections will be empty.<br>
><br>
>One interesting case you might want to add a test for and check what<br>
>bfd and gold do:<br>
><br>
</span>>A section name matches two entries in the SECTIONS directive. The<br>
<span class="">>first one doesn't have KEEP, the second one does.<br>
><br>
</span>Like that ?<br>
<br>
SECTIONS {<br>
 .temp : { *(.keep) }<br>
 .keep : { KEEP(*(.keep)) }<br>
}<br>
vs<br>
SECTIONS {<br>
 .keep : { KEEP(*(.keep)) }<br>
 .temp : { *(.keep) }<br>
}<br>
<br>
For first case gold does not keep the section, for second - it does. So it depends on order.<br>
KEEP patch has the equal behavior. I updated the test cases to demonstrate.<br></blockquote><div><br></div><div>Can you test with ld.bfd? Gold's behavior seems almost like it could be an accident. If ld.bfd disagrees about this then we might need to pay extra attention here (and perhaps want to follow ld.bfd's semantics since ld.bfd is much more prevalent).</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
>I suggest that because I possible "optimization" that I though was to<br>
>check match only on section that have the Keep flag, but that would<br>
>change the result in this case.<br>
><br>
>Cheers,<br>
>Rafael<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>