Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Apr 2021 03:36:07 +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-nkrdg7sBeG@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-254774-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-254774-227@https.bugs.freebsd.org/bugzilla/>

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

--- Comment #4 from maskray <emacsray@gmail.com> ---
I want to use dlpi_tls_data for static TLS blocks (from the main executable=
 and
initially loaded shared objects).
Working dynamic TLS blocks will be nice to have for consistency.

I will try calling __tls_get_addr({tls_modid,0}) as a workaround, but it
probably forces allocation (at least in glibc; I guess FreeBSD rtld/libc ma=
y be
similar) so slightly inferior (but not matters for most not-too-size-concer=
ned
applications).

If you are interested, there is a complex story behind "why does sanitizer
runtime need to know static/dynamic TLS blocks".
In the end I think we may need libc APIs. Once I know the context sufficien=
tly
well, I shall start a discussion on https://www.openwall.com/lists/libc-coo=
rd

Currently I have written down some notes in
https://maskray.me/blog/2021-02-14-all-about-thread-local-storage#why-does-=
compiler-rt-need-to-know-tls-blocks
Precise static TLS blocks tracking is more important than precise dynamic T=
LS
blocks.

--=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-nkrdg7sBeG>