[PATCH] [lld] [ELF] Support for general dynamic TLS relocations on X86_64

Rafael Auler rafaelauler at gmail.com
Fri Sep 26 13:32:59 PDT 2014


__tls_get_addr is a regular, non-weak versioned symbol from the dynamic linker and loader. For example:

$ readelf -a /lib64/ld-linux-x86-64.so.2
...
    21: 0000000000013340    55 FUNC    GLOBAL DEFAULT   11 __tls_get_addr@@GLIBC_2.3
...

The only difference to a regular lib is that you don't need to pass "-lsomelibname" to link against it but, rather, it is an implicit library that is always present. Another difference is that you don't need to put a DT_NEEDED tag to request the "ld.so" library: it will already be loaded because it is the dynamic linker and loader.

Since we can't rely on a ld.so to link against, but we must implicitly provide this symbol, I put this as an explicit atom. Since it will come from a lib at runtime, I modelled this as a subclass of SharedLibraryAtom.

http://reviews.llvm.org/D5505






More information about the llvm-commits mailing list