MaskRay added a comment.

I don't think this belongs to the upstream, either. Note: musl's TLS 
implementation is very clean and  may be a good reference.

https://maskray.me/blog/2021-02-14-all-about-thread-local-storage

> glibc ld.so reserves some space in static TLS blocks and allows dlopen on 
> such a shared object if its TLS size is small. There could be an obscure 
> reason for using such an attribute: general dynamic and local dynamic TLS 
> models are not async-signal-safe in glibc. However, other libc 
> implementations may not reserve additional TLS space for dlopen'ed 
> initial-exec shared objects, e.g. musl will error.

glibc's model makes it very error-prone, even if dlopen TLS is supported to 
some extent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154397

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to