This may be a better question for the linaro tools group.  +cc their list for the general question of conventions surrounding how shared library objects identify and access thread-local storage that they need as part of calling threads.

On Tue, May 17, 2016 at 11:06 AM, Nikhil Agarwal <nikhil.agarwal@linaro.org> wrote:

Hi All,

I am trying to write a shared library object over ODP. Our ODP library has some per thread variables. When my application invokes an API of shared object which accesses per thread variable it gives segmentation fault.

My concern is that when a shared object is loaded dynamically, how memory is assigned to thread specific variables defined inside shared objects. AFAIK we need to compile it with -ftls-model=global-dynamic, which is enabled by default when compiled with -fPIC flag, and library loader takes care for these issues.

I am not an expert in this area, please help me in getting to some suitable reference pointers or some steps I might have missed.

Thanks in advance

Nikhil