[lld] 910204c - [ELF] createSyntheticSections: simplify config->relocatable. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 20:09:21 PST 2022


Author: Fangrui Song
Date: 2022-11-22T20:09:15-08:00
New Revision: 910204cfbdf3d29f1a840c11fe35787500bb57a7

URL: https://github.com/llvm/llvm-project/commit/910204cfbdf3d29f1a840c11fe35787500bb57a7
DIFF: https://github.com/llvm/llvm-project/commit/910204cfbdf3d29f1a840c11fe35787500bb57a7.diff

LOG: [ELF] createSyntheticSections: simplify config->relocatable. NFC

We can add .riscv.attributes synthetic section here in the future.

Added: 
    

Modified: 
    lld/ELF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index eb5ebc8bdf8c..ae2b7ffe4f97 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -398,13 +398,12 @@ template <class ELFT> void elf::createSyntheticSections() {
       }
       part.ehFrame = std::make_unique<EhFrameSection>();
       add(*part.ehFrame);
-    }
 
-    if (config->emachine == EM_ARM && !config->relocatable) {
-      // The ARMExidxsyntheticsection replaces all the individual .ARM.exidx
-      // InputSections.
-      part.armExidx = std::make_unique<ARMExidxSyntheticSection>();
-      add(*part.armExidx);
+      if (config->emachine == EM_ARM) {
+        // This section replaces all the individual .ARM.exidx InputSections.
+        part.armExidx = std::make_unique<ARMExidxSyntheticSection>();
+        add(*part.armExidx);
+      }
     }
 
     if (!config->packageMetadata.empty()) {


        


More information about the llvm-commits mailing list