4 ms·
Yes, but what you describe only happens if you try to access the TLS variables directly. If I put all the TLS variable in a .so file, and only access them throu
by HexDecOctBin 6y ago
Yes, but what you describe only happens if you try to access the TLS variables directly. If I put all the TLS variable in a .so file, and only access them through getter/setter functions (also part of the .so), can compiler optimisations still screw things up? It seems to me that unless there is some runtime optimisation going on, this method should be safe.
- gpderetta 6y agoPutting the code to a separate .so is very unlikely to break, unless C++ compilers start doing code generation at dynamic link time. LTO is a thing though, putting it in a separate translation unit doesn't help when static linking.