This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Finding the source code for ___tls_get_addr_internal()


On Wed, Jan 16, 2013 at 12:08 PM, Saul Tamari <stamari@gmail.com> wrote:
>
> Is ___tls_get_addr_internal() compiled from C source code or is it
> generated directly in assembly code?
> Where can I find the C source code that was used to generate
> ___tls_get_addr_internal ?

__tls_get_addr is provided by your C library.  I don't think you
mentioned what system you are using, but if it is a GNU/Linux system
then __tls_get_addr defined by glibc.  I'm not sure quite where
__tls_get_addr_internal comes in.  __tls_get_addr is defined in
elf/dl-tls.c in the glibc sources.  You seem to be using 32-bit x86;
the interesting 32-bit x86 code is in nptl/sysdeps/i386/tls.h.

It does indeed use %gs.  You can't change %gs yourself if your program
uses TLS variables.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]