[PATCH] D102570: [ELF] Add -Bsymbolic-non-weak-functions

Dan Albert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 15:27:57 PDT 2021


danalbert added a comment.

In D102570#2914756 <https://reviews.llvm.org/D102570#2914756>, @MaskRay wrote:

> In D102570#2914731 <https://reviews.llvm.org/D102570#2914731>, @smeenai wrote:
>
>> Do you plan to land this? I thought of it as potentially useful for https://github.com/android/ndk/issues/1551. The issue has the full details, but the summary is that we only want a single copy of `__emutls_get_address` that's used by all shared objects in a process, otherwise different DSOs will see different emulated TLS state for the same variable. One way to ensure that would be to put the emulated TLS bits in their own DSO and have everyone else reference that, but a full DSO is pretty heavy-weight. Another would be to make it default visibility and weak and let the dynamic linker coalesce multiple copies at runtime; `-Bsymbolic` and `-Bsymbolic-functions` would break that, but `-Bsymbolic-non-weak-functions` wouldn't.
>
> I was waiting for users:) Glad that this can find a user.

I think I can deliver quite a few more :) I hadn't seen this patch before (thanks @smeenai for the heads up). It sounds like what Android would want to do by default.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102570/new/

https://reviews.llvm.org/D102570



More information about the llvm-commits mailing list