[lld] a2648bc - [ELF] Remove remnant ranks for PPC64 ELFv1 special sections

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 23:21:19 PDT 2023


Author: Fangrui Song
Date: 2023-05-12T23:21:14-07:00
New Revision: a2648bc4ea726be31ea5ae0acc64e84ffbc6aa16

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

LOG: [ELF] Remove remnant ranks for PPC64 ELFv1 special sections

Added: 
    

Modified: 
    lld/ELF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index ddfda6ca34b81..ffbe798720340 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -840,8 +840,6 @@ enum RankFlags {
   RF_NOT_RELRO = 1 << 9,
   RF_NOT_TLS = 1 << 8,
   RF_BSS = 1 << 7,
-  RF_PPC_NOT_TOCBSS = 1 << 6,
-  RF_PPC_TOCL = 1 << 5,
   RF_PPC_TOC = 1 << 4,
   RF_PPC_GOT = 1 << 3,
   RF_PPC_BRANCH_LT = 1 << 2,
@@ -943,16 +941,8 @@ static unsigned getSectionRank(const OutputSection &osec) {
     // PPC64 has a number of special SHT_PROGBITS+SHF_ALLOC+SHF_WRITE sections
     // that we would like to make sure appear is a specific order to maximize
     // their coverage by a single signed 16-bit offset from the TOC base
-    // pointer. Conversely, the special .tocbss section should be first among
-    // all SHT_NOBITS sections. This will put it next to the loaded special
-    // PPC64 sections (and, thus, within reach of the TOC base pointer).
+    // pointer.
     StringRef name = osec.name;
-    if (name != ".tocbss")
-      rank |= RF_PPC_NOT_TOCBSS;
-
-    if (name == ".toc1")
-      rank |= RF_PPC_TOCL;
-
     if (name == ".toc")
       rank |= RF_PPC_TOC;
 


        


More information about the llvm-commits mailing list