Solaris/x86 port - how to get the TLS section?

Kai Nacke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Nov 25 09:59:46 PST 2014


Hi!

GitHub master contains a close-to-working port of LDC to 
Solaris/x86. The only missing piece is getting a pointer to the 
TLS section. I tried the following:

1) Solaris uses the ELF file format. Unfortunately, it does not 
support the dl_phdr_info.dlpi_tls_modid field which is used on 
FreeBSD to get the module id of the TLS section.

2) On glibc-based systems, the function dlinfo(RTLD_SELF, 
RTLD_DI_TLS_MODID, &modid) can be used to get the module id. 
Again, this is not supported on Solaris.

Does somebody else know a way to get a pointer to or the module 
id of the TLS section? Maybe a linkmap or a /proc/<pid>/map based 
solution? Every suggestion is welcome!

Regards,
Kai


More information about the digitalmars-d-ldc mailing list