[lld] 371290d - [ELF] Remove unneeded DF_STATIC_TLS for EM_386 local-exec TLS

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 20:44:03 PST 2021


Author: Fangrui Song
Date: 2021-11-24T20:43:58-08:00
New Revision: 371290dfd400c5c26843b9c127ae13968cafdf2e

URL: https://github.com/llvm/llvm-project/commit/371290dfd400c5c26843b9c127ae13968cafdf2e
DIFF: https://github.com/llvm/llvm-project/commit/371290dfd400c5c26843b9c127ae13968cafdf2e.diff

LOG: [ELF] Remove unneeded DF_STATIC_TLS for EM_386 local-exec TLS

which is also untested.

Added: 
    

Modified: 
    lld/ELF/Arch/X86.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Arch/X86.cpp b/lld/ELF/Arch/X86.cpp
index 5d34b769e80ec..6b0fae3b6d73d 100644
--- a/lld/ELF/Arch/X86.cpp
+++ b/lld/ELF/Arch/X86.cpp
@@ -78,12 +78,7 @@ int X86::getTlsGdRelaxSkip(RelType type) const {
 
 RelExpr X86::getRelExpr(RelType type, const Symbol &s,
                         const uint8_t *loc) const {
-  // There are 4 
diff erent TLS variable models with varying degrees of
-  // flexibility and performance. LocalExec and InitialExec models are fast but
-  // less-flexible models. If they are in use, we set DF_STATIC_TLS flag in the
-  // dynamic section to let runtime know about that.
-  if (type == R_386_TLS_LE || type == R_386_TLS_LE_32 || type == R_386_TLS_IE ||
-      type == R_386_TLS_GOTIE)
+  if (type == R_386_TLS_IE || type == R_386_TLS_GOTIE)
     config->hasStaticTlsModel = true;
 
   switch (type) {


        


More information about the llvm-commits mailing list