Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Apr 2021 23:51:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 254774] [rtld] dl_iterate_phdr: dlpi_tls_data should be the iterated module's TLS image instead of TLS initialization image
Message-ID:  <bug-254774-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254774

            Bug ID: 254774
           Summary: [rtld] dl_iterate_phdr: dlpi_tls_data should be the
                    iterated module's TLS image instead of TLS
                    initialization image
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: emacsray@gmail.com

glibc d78efd9f369a8fc46229fc9224e10e3781eecc43 (2006-02) introduced
dlpi_tls_modid and dlpi_tls_data.
dlpi_tls_data is the allocated TLS image associated to the module
dlpi_tls_modid.

The Linux manpage documents the two members as:

               size_t dlpi_tls_modid;
                               /* If there is a PT_TLS segment, its module
                                  ID as used in TLS relocations, else zero =
*/
               void  *dlpi_tls_data;
                               /* The address of the calling thread's insta=
nce
                                  of this module's PT_TLS segment, if it has
                                  one and it has been allocated in the call=
ing
                                  thread, otherwise a null pointer */

In FreeBSD, dlpi_tls_data is however the TLS initialization image as part of
the underlying file.


I plan to use dl_iterate_phdr in compiler-rt's sanitizer runtime to simplify
TLS handling,
but unfortunately FreeBSD dlpi_tls_data does not have the desired semantics=
 :(

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-254774-227>