<div dir="ltr"><div dir="ltr"> I should have read this thread first.</div><div dir="ltr"><br></div><div dir="ltr">On Sat, May 18, 2019 at 1:55 AM Rich Felker via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">dalias added a comment.<br>
<br>
The waste is not just 48 bytes in the ELF image on disk, but up to 63 bytes in each thread. Depending on how that falls, the waste is likely actually either 0 bytes or 4096 bytes per thread, since the memory is allocated with page granularity.<br>
<br>
Forcing the alignment will also force musl to *always* mmap space (on page granularity, so A LOT of waste) for the main thread's TLS at startup, rather than using the built-in bss space intended to be used when the application's TLS needs are small, since the built-in space does not have excess alignment. This imposes a syscall as well, and a new failure mode for static-linked binaries that may have been intended not to be able to fail after exec.<br></blockquote><div><br></div><div>I honestly don't think that 48 waste on average per a thread matters, as a thread isn't that cheap anyway. But the second thing you mentioned is indeed concerning. Given the pushback from libc side, hiding the hack for Bionic under --android-tls seems to make more sense.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Please, drop this ridiculous and costly hack for Bionic or put it under the --android-tls option or whatever.<br>
<br>
<br>
Repository:<br>
  rLLD LLVM Linker<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D61824/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D61824/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D61824" rel="noreferrer" target="_blank">https://reviews.llvm.org/D61824</a><br>
<br>
<br>
<br>
</blockquote></div></div>