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

kledzik at apple.com kledzik at apple.com
Fri Sep 26 19:05:20 PDT 2014


>  should we add a special case to the reader to convert them to weak undefines?
That is what I was thinking.  But you should investigate how this works with the gnu linker.  Does the linker really hard code "__tls_get_addr" to be special?  Or does it always implicitly link with ld.so? 

>canBeNullAtBuildTime is associated with a weak symbol while __tls_get_addr is not a weak symbo in the writer, which changes the symbol semantics.
I'm not sure what you are saying here.  If "__tls_get_adder" was a weak *undefined* symbol in the .o file, everything would work correctly. Static linking ignores the canBeNullAtBuildTime aspect of UndefinedAtoms, so either it is defined in an archive, or you get a linker error.  For dynamic executables, if it "__tls_get_adder"  not defined anywhere, the linker notices the canBeNullAtBuildTime and conjures up a SharedLibraryAtom for it.

http://reviews.llvm.org/D5505






More information about the llvm-commits mailing list