This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Why does __tls_get_addr call require @PLT for global-dynamic without -fpic?
- From: "H.J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org, GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Mon, 13 Aug 2007 10:26:57 -0700
- Subject: Why does __tls_get_addr call require @PLT for global-dynamic without -fpic?
Is there a particular reason for x86 and x86-64 global-dynamic TLS
model to require @PLT when calling __tls_get_addr when PIC isn't
required? See
http://sources.redhat.com/bugzilla/show_bug.cgi?id=4918
Right now, gcc doesn't generate PLT when calling __tls_get_addr
without -fpic. Assert in x86/x86-64 linkers fail because of it.
The only thing I can think of is it is used to make sure that it is
a call instruction. I may have missed something. If not, I'd like to
change it to check for R_X86_64_32/R_X86_64_PLT32 and call
__tls_get_addr explicitly.
H.J.