Linking TLS in shared libraries
Jakub Jelinek
jakub@redhat.com
Thu Jan 6 22:52:00 GMT 2005
On Thu, Jan 06, 2005 at 05:45:39PM -0500, Daniel Jacobowitz wrote:
> I've noticed that all the TLS tests which build a shared library containing
> LD or GD model data aren't (can't be) built with -z defs. This seems
> undesirable... the reason is that GNU ld does not load DT_NEEDED entries
> when linking -shared, for reasons which I don't quite grok. But this is
> what it's done as far back as I checked.
>
> Would it be reasonable to include ld.so in the libc.so linker script? Are
> there any other possible fixes?
Ulrich suggested this week extending ld to handle:
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) )
in the linker script, where the AS_NEEDED would temporarily turn on
as_needed and then restore the previous value of that variable.
I just have not got to implement that yet.
Having ld.so in DT_NEEDED of all programs and all libraries is not
necessary.
Jakub
More information about the Libc-alpha
mailing list