Re: Getting offset of inital-exec TLS variables on GNU/Linux

Florian Weimer <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
* Simon Marchi:

> On 2019-05-17 6:21 a.m., Florian Weimer wrote:
>> Is it possible to obtain the offset of initial-exec TLS variable on
>> GNU/Linux?
>> 
>> It doesn't seem so because GDB executes the DWARF to access the TLS
>> variable, so the offset is an implementation detail.  Although it is
>> often visible at the ELF layer.
>> 
>> Thanks,
>> Florian
>
> Can you clarify a little bit?
>
> You are looking for the offset the variable from which point of reference:
>
> - The start of the TLS area of this module?
> - The start of the TLS area of the current thread?

The offset from something related to the thread pointer to the variable,
for cases where this is constant (specifically, initial-exec TLS
variables).

> Also, are you looking for something you can find statically, with just the
> executable, or are you working in the context of the live process?

I have a live process, and it would be best if the information matched
that process (even if it uses different libraries than those currently
installed in the file system).

Thanks,
Florian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.