<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div>
<blockquote type="cite" class="">
<div class="">Le 2 oct. 2017 à 18:37, Rui Ueyama <<a href="mailto:ruiu@google.com" class="">ruiu@google.com</a>> a écrit :</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Changing default to "both" is probably fine, but what does that change actually mean in practice? I believe clang already passes --hash-style=both to the linker by default.</div>
</div>
</blockquote>
</div>
<br class="">
<div class="">Not exactly.</div>
<div class=""><br class="">
</div>
<div class="">The current Linux driver (I haven't checked other ELF-based systems) reads this (<a href="https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains/Linux.cpp#L228" class="">https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains/Linux.cpp#L228</a>)</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
  // Do not use 'gnu' hash style for Mips targets because .gnu.hash<br class="">
  // and the MIPS ABI require .dynsym to be sorted in different ways.<br class="">
  // .gnu.hash needs symbols to be grouped by hash code whereas the MIPS<br class="">
  // ABI requires a mapping between the GOT and the symbol table.<br class="">
  // Android loader does not support .gnu.hash.<br class="">
  // Hexagon linker/loader does not support .gnu.hash<br class="">
  if (!IsMips && !IsAndroid && !IsHexagon) {<br class="">
    if (Distro.IsRedhat() || Distro.IsOpenSUSE() ||<br class="">
        (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick))<br class="">
      ExtraOpts.push_back("--hash-style=gnu");<br class="">
<br class="">
    if (Distro.IsDebian() || Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid ||<br class="">
        Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic)<br class="">
      ExtraOpts.push_back("--hash-style=both");<br class="">
  }</div>
<div class=""><br class="">
</div>
<div class="">Given that several libc implementation supports this in the Linux ecosystem (glibc, musl, uClibc, most likely others) I think lld should provide good defaults by default, instead of relying on what some distro maintainer have hardcoded for their
 own distro in clang.</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">ROmain</div>
</body>
</html>