<div dir="ltr">To wrap up, looks like this is what we should do:<br><div><br></div><div> - Use -hash-style=both as a default except MIPS.</div><div> - For MIPS, use -hash-style=sysv as a default.</div><div><br></div><div>We'll make a change accordingly.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 2, 2017 at 4:22 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Oct 2, 2017 at 4:15 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't think there is much value in being different from the gnu<br>
linkers in here since the common case is to have the compiler driver<br>
pass an explicit option.<br>
<br>
So +1 to changing the default to "both".<br></blockquote><div><br></div></span><div>... except for MIPS, as the way how we need to sort .gnu.hash section contents is not compatible with a MIPS ABI requirement.</div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Cheers,<br>
Rafael<br>
<div class="m_7007765852255392910m_-5807933246635257305HOEnZb"><div class="m_7007765852255392910m_-5807933246635257305h5"><br>
George Rimar <<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>> writes:<br>
<br>
> Hi !<br>
><br>
> During linking LLD and other linkers builds a static hash table for dynamic symbols,<br>
> so that in runtime dynamic linker can use this table and find symbols faster.<br>
><br>
> --hash-style=style linker option is used to select the hash type:<br>
> "Set the type of linker's hash table(s). style can be either "sysv" for classic ELF ".hash" section,<br>
> "gnu" for new style GNU ".gnu.hash" section or "both" for both the classic ELF ".hash" and new<br>
> style GNU ".gnu.hash" hash tables. The default is "sysv"."<br>
><br>
> GNU_HASH format is a better version of hash table (<a href="https://sourceware.org/ml/binutils/2006-10/msg00377.html" rel="noreferrer" target="_blank">https://sourceware.org/ml/bin<wbr>utils/2006-10/msg00377.html</a>).<br>
><br>
> We have --hash-style=sysv currently set by default in LLD.<br>
> Though recently (see <a href="https://bugs.llvm.org//show_bug.cgi?id=34712" rel="noreferrer" target="_blank">https://bugs.llvm.org//show_bu<wbr>g.cgi?id=34712</a>) GNU linkers switched to use<br>
> ".gnu.hash" section format in addition to normally used classic ".hash".<br>
> So they defaults --hash-style to "both" and this looks to be released with binutils 2.30.<br>
><br>
> I think we can switch LLD either to "both" or probably to "gnu" by default as well.<br>
> Initial version of patch that changes default to "both" is here: D38407<br>
><br>
> Any thoughts ?<br>
><br>
> Best regards,<br>
> George | Developer | Access Softek, Inc<br>
</div></div></blockquote></span></div><br></div></div>
</blockquote></div><br></div>