[lld] 7aafe46 - [ELF] Simplify a condition with config->copyRelocs. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 13:59:27 PST 2021


Author: Fangrui Song
Date: 2021-11-22T13:59:23-08:00
New Revision: 7aafe467d2aa6307d34c5762b8c3bf843d713737

URL: https://github.com/llvm/llvm-project/commit/7aafe467d2aa6307d34c5762b8c3bf843d713737
DIFF: https://github.com/llvm/llvm-project/commit/7aafe467d2aa6307d34c5762b8c3bf843d713737.diff

LOG: [ELF] Simplify a condition with config->copyRelocs. NFC

Added: 
    

Modified: 
    lld/ELF/InputFiles.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index e8a4188ec775d..9399bb4484f03 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -966,7 +966,7 @@ InputSectionBase *ObjFile<ELFT>::createInputSection(uint32_t idx,
     // `nullptr` for the normal case. However, if -r or --emit-relocs is
     // specified, we need to copy them to the output. (Some post link analysis
     // tools specify --emit-relocs to obtain the information.)
-    if (!config->relocatable && !config->emitRelocs)
+    if (!config->copyRelocs)
       return nullptr;
     InputSection *relocSec = make<InputSection>(*this, sec, name);
     // If the relocated section is discarded (due to /DISCARD/ or


        


More information about the llvm-commits mailing list