[lld] 9aad886 - [ELF] Simplify a condition in addGotEntry. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 22:11:20 PDT 2021


Author: Fangrui Song
Date: 2021-04-23T22:11:14-07:00
New Revision: 9aad886e28e489f14c606b33469fbc5b0ccf36c5

URL: https://github.com/llvm/llvm-project/commit/9aad886e28e489f14c606b33469fbc5b0ccf36c5
DIFF: https://github.com/llvm/llvm-project/commit/9aad886e28e489f14c606b33469fbc5b0ccf36c5.diff

LOG: [ELF] Simplify a condition in addGotEntry. NFC

Added: 
    

Modified: 
    lld/ELF/Relocations.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 8e4af09cfe021..d6615e1eaa275 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -1097,7 +1097,7 @@ static void addGotEntry(Symbol &sym) {
 
   // Otherwise, we emit a dynamic relocation to .rel[a].dyn so that
   // the GOT slot will be fixed at load-time.
-  if (!sym.isTls() && !sym.isPreemptible && config->isPic && !isAbsolute(sym)) {
+  if (!sym.isTls() && !sym.isPreemptible && config->isPic) {
     addRelativeReloc(in.got, off, &sym, 0, R_ABS, target->symbolicRel);
     return;
   }


        


More information about the llvm-commits mailing list