[PATCH] [lld] [ELF] Support for general dynamic TLS relocations on X86_64
rafaelauler at gmail.com
Mon Sep 29 12:50:59 PDT 2014
I have a few minor updates to this patch.
1. I enhanced the test case to also check whether the PLT32 relocation against tls_get_addr is being properly generated in a shared lib, if it uses TLS.
2. When I removed the tlsgetaddr atom, the PLT32 relocation against tls_get_addr stopped being generated. I fixed this in a logic in the X86_64RelocationPass.cpp that would only add a PLT relocation if the symbol came from a SharedLib. I changed this to add whenever it comes from a SharedLIb <or> if it is undefined, because we can't leave a PLT32 unresolved if the target is not defined.
3. I removed the logic that checks whether the symbol comes from the dynamic linker and, if so, do not add it to DT_NEEDED. This logic is quite expensive (needs to strcmp every symbol that is being added to the dynamic symbol table) and I am not sure if this is necessary, I only did it to mimic gnu ld.
If you want to accept this patch, could you please commit it? I don't have commit access.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 27843 bytes
Desc: not available
More information about the llvm-commits