Getting tls symbols out of the compiler.

Jacob Carlborg doob at me.com
Fri May 31 00:42:10 PDT 2013


On 2013-05-30 12:13, Johannes Pfau wrote:

> AFAIK he also changed how TLS sections are looked up for the main
> executable. _tlsstart and _tlsend are not used anymore. Instead some
> mainly undocumented obscure glibc interface is used to ask the runtime
> linker for the start and end of the TLS section.

He uses "dl_iterate_phdr" to iterate all shared libraries. Then iterates 
all segments/sections to find the ones used for TLS.

Documented here, no secrets :)

http://linux.die.net/man/3/dl_iterate_phdr

-- 
/Jacob Carlborg


More information about the D.gnu mailing list