Re: Accessing TLS variable defined in DSO with static tls model from another DSO with dynamic tls model

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 27 May 2021, Ho, Lennox via Gcc-help wrote:

> So my question is, is there a way to inform gcc that my_tls is always located
> in a static TLS segment and so it can just emit a @gottpoff placeholder
> instead of __tls_get_addr() in libtls_import.so?

You need to pass -ftls-model=initial-exec when compiling libtls_import.so, not
the exporting library. I am a bit surprised you've decided to do that the other
way around :)

(alternatively, you could place __attribute__((tls_model("initial-exec")))
on the declaration of the variable in the header file)

Alexander



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux