diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2021-04-05 03:05:44 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-04-06 00:23:08 +0000 |
| commit | d36d6816151705907393889d661cbfd25c630ca8 (patch) | |
| tree | 7d105ce0cfee5f3754f917743d4cf7de209070e2 /libexec | |
| parent | 843d16436d3388c1b46d37fca4e86885612d0e64 (diff) | |
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rtld-elf/Symbol.map | 1 | ||||
| -rw-r--r-- | libexec/rtld-elf/rtld.1 | 7 | ||||
| -rw-r--r-- | libexec/rtld-elf/rtld.c | 8 |
3 files changed, 15 insertions, 1 deletions
diff --git a/libexec/rtld-elf/Symbol.map b/libexec/rtld-elf/Symbol.map index 13068c5626dc..0a9eac82cf05 100644 --- a/libexec/rtld-elf/Symbol.map +++ b/libexec/rtld-elf/Symbol.map @@ -34,4 +34,5 @@ FBSDprivate_1.0 { _r_debug_postinit; _rtld_version__FreeBSD_version; _rtld_version_laddr_offset; + _rtld_version_dlpi_tls_data; }; diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 589b9a92aa77..7f633ce0b486 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -424,6 +424,13 @@ See Also it indicates the presence of .Va l_refname member of the structure. +.It Dv _rtld_version_dlpi_tls_data +The +.Va dlpi_tls_data +member of the structure +.Vt dl_phdr_info +contains the address of the module TLS segment for the calling thread, +and not the address of the initialization segment. .El .Sh FILES .Bl -tag -width ".Pa /var/run/ld-elf32.so.hints" -compact diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 733c3c80b70f..19027518d3c2 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3909,13 +3909,16 @@ dlinfo(void *handle, int request, void *p) static void rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info) { + tls_index ti; phdr_info->dlpi_addr = (Elf_Addr)obj->relocbase; phdr_info->dlpi_name = obj->path; phdr_info->dlpi_phdr = obj->phdr; phdr_info->dlpi_phnum = obj->phsize / sizeof(obj->phdr[0]); phdr_info->dlpi_tls_modid = obj->tlsindex; - phdr_info->dlpi_tls_data = obj->tlsinit; + ti.ti_module = obj->tlsindex; + ti.ti_offset = 0; + phdr_info->dlpi_tls_data = __tls_get_addr(&ti); phdr_info->dlpi_adds = obj_loads; phdr_info->dlpi_subs = obj_loads - obj_count; } @@ -5914,3 +5917,6 @@ int _rtld_version__FreeBSD_version = __FreeBSD_version; extern char _rtld_version_laddr_offset __exported; char _rtld_version_laddr_offset; + +extern char _rtld_version_dlpi_tls_data __exported; +char _rtld_version_dlpi_tls_data; |
