Assume we have the following code in some compilation unit that eventually is compiled to a shared lib on Linux (g++ 4.9)
namespace A {
class B {
static __thread MyObj *myobj;
};
}
So this is compiled into .so and it does not export this symbol (using visibility hidden).
Now, a specific app has the same piece of code that is being used. I.e. same cpp compilation unit is linked with this app, that also access the above shared lib.
Question - are these 2 myobj instances resides in 2 different addresses in TLS? I assume yes but I'm seeing issues that might be related to the above configuration.