[lld] r251980 - Create .bss only when needed.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 3 13:35:15 PST 2015


Author: rafael
Date: Tue Nov  3 15:35:14 2015
New Revision: 251980

URL: http://llvm.org/viewvc/llvm-project?rev=251980&view=rev
Log:
Create .bss only when needed.

This is a small complication, but produces nicer output and is a step to
handling zero size sections uniformly.

Modified:
    lld/trunk/ELF/OutputSections.h
    lld/trunk/ELF/Writer.cpp
    lld/trunk/test/elf2/basic-aarch64.s
    lld/trunk/test/elf2/basic.s
    lld/trunk/test/elf2/basic32.s
    lld/trunk/test/elf2/basic64be.s
    lld/trunk/test/elf2/merge-shared.s
    lld/trunk/test/elf2/string-table.s
    lld/trunk/test/elf2/tls.s

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Tue Nov  3 15:35:14 2015
@@ -378,7 +378,7 @@ template <class ELFT> GotPltSection<ELFT
 template <class ELFT> GotSection<ELFT> *Out<ELFT>::Got;
 template <class ELFT> HashTableSection<ELFT> *Out<ELFT>::HashTab;
 template <class ELFT> InterpSection<ELFT> *Out<ELFT>::Interp;
-template <class ELFT> OutputSection<ELFT> *Out<ELFT>::Bss;
+template <class ELFT> OutputSection<ELFT> *Out<ELFT>::Bss = nullptr;
 template <class ELFT> OutputSectionBase<ELFT> *Out<ELFT>::Opd;
 template <class ELFT> uint8_t *Out<ELFT>::OpdBuf;
 template <class ELFT> PltSection<ELFT> *Out<ELFT>::Plt;

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Nov  3 15:35:14 2015
@@ -60,6 +60,10 @@ private:
   uintX_t getEntryAddr() const;
   int getPhdrsNum() const;
 
+  OutputSection<ELFT> *getBSS();
+  void addCommonSymbols(std::vector<DefinedCommon<ELFT> *> &Syms);
+  void addSharedCopySymbols(std::vector<SharedSymbol<ELFT> *> &Syms);
+
   std::unique_ptr<llvm::FileOutputBuffer> Buffer;
 
   SpecificBumpPtrAllocator<OutputSection<ELFT>> SecAlloc;
@@ -93,8 +97,6 @@ template <class ELFT> void lld::elf2::wr
     Out<ELFT>::StrTab = &StrTab;
   StringTableSection<ELFT> DynStrTab(".dynstr", true);
   Out<ELFT>::DynStrTab = &DynStrTab;
-  OutputSection<ELFT> Bss(".bss", SHT_NOBITS, SHF_ALLOC | SHF_WRITE);
-  Out<ELFT>::Bss = &Bss;
   GotSection<ELFT> Got;
   Out<ELFT>::Got = &Got;
   GotPltSection<ELFT> GotPlt;
@@ -375,13 +377,25 @@ static bool compareOutputSections(Output
   return false;
 }
 
+template <class ELFT> OutputSection<ELFT> *Writer<ELFT>::getBSS() {
+  if (!Out<ELFT>::Bss) {
+    Out<ELFT>::Bss = new (SecAlloc.Allocate())
+        OutputSection<ELFT>(".bss", SHT_NOBITS, SHF_ALLOC | SHF_WRITE);
+    OutputSections.push_back(Out<ELFT>::Bss);
+  }
+  return Out<ELFT>::Bss;
+}
+
 // Until this function is called, common symbols do not belong to any section.
 // This function adds them to end of BSS section.
 template <class ELFT>
-static void addCommonSymbols(std::vector<DefinedCommon<ELFT> *> &Syms) {
+void Writer<ELFT>::addCommonSymbols(std::vector<DefinedCommon<ELFT> *> &Syms) {
   typedef typename ELFFile<ELFT>::uintX_t uintX_t;
   typedef typename ELFFile<ELFT>::Elf_Sym Elf_Sym;
 
+  if (Syms.empty())
+    return;
+
   // Sort the common symbols by alignment as an heuristic to pack them better.
   std::stable_sort(
     Syms.begin(), Syms.end(),
@@ -389,7 +403,7 @@ static void addCommonSymbols(std::vector
       return A->MaxAlignment > B->MaxAlignment;
     });
 
-  uintX_t Off = Out<ELFT>::Bss->getSize();
+  uintX_t Off = getBSS()->getSize();
   for (DefinedCommon<ELFT> *C : Syms) {
     const Elf_Sym &Sym = C->Sym;
     uintX_t Align = C->MaxAlignment;
@@ -402,12 +416,16 @@ static void addCommonSymbols(std::vector
 }
 
 template <class ELFT>
-static void addSharedCopySymbols(std::vector<SharedSymbol<ELFT> *> &Syms) {
+void Writer<ELFT>::addSharedCopySymbols(
+    std::vector<SharedSymbol<ELFT> *> &Syms) {
   typedef typename ELFFile<ELFT>::uintX_t uintX_t;
   typedef typename ELFFile<ELFT>::Elf_Sym Elf_Sym;
   typedef typename ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
 
-  uintX_t Off = Out<ELFT>::Bss->getSize();
+  if (Syms.empty())
+    return;
+
+  uintX_t Off = getBSS()->getSize();
   for (SharedSymbol<ELFT> *C : Syms) {
     const Elf_Sym &Sym = C->Sym;
     const Elf_Shdr *Sec = C->File->getSection(Sym);
@@ -443,10 +461,6 @@ template <class ELFT> void Writer<ELFT>:
 
   SmallDenseMap<SectionKey<ELFT::Is64Bits>, OutputSectionBase<ELFT> *> Map;
 
-  OutputSections.push_back(Out<ELFT>::Bss);
-  Map[{Out<ELFT>::Bss->getName(), Out<ELFT>::Bss->getType(),
-       Out<ELFT>::Bss->getFlags(), 0}] = Out<ELFT>::Bss;
-
   std::vector<OutputSectionBase<ELFT> *> RegularSections;
 
   for (const std::unique_ptr<ObjectFile<ELFT>> &F : Symtab.getObjectFiles()) {
@@ -481,6 +495,9 @@ template <class ELFT> void Writer<ELFT>:
     }
   }
 
+  Out<ELFT>::Bss = static_cast<OutputSection<ELFT> *>(
+      Map[{".bss", SHT_NOBITS, SHF_ALLOC | SHF_WRITE, 0}]);
+
   Out<ELFT>::Dynamic->PreInitArraySec = Map.lookup(
       {".preinit_array", SHT_PREINIT_ARRAY, SHF_WRITE | SHF_ALLOC, 0});
   Out<ELFT>::Dynamic->InitArraySec =

Modified: lld/trunk/test/elf2/basic-aarch64.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/basic-aarch64.s?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/test/elf2/basic-aarch64.s (original)
+++ lld/trunk/test/elf2/basic-aarch64.s Tue Nov  3 15:35:14 2015
@@ -26,15 +26,15 @@ _start:
 # CHECK-NEXT:   Version: 1
 # CHECK-NEXT:   Entry: [[ENTRY:0x[0-9A-F]+]]
 # CHECK-NEXT:   ProgramHeaderOffset: 0x40
-# CHECK-NEXT:   SectionHeaderOffset: 0x1090
+# CHECK-NEXT:   SectionHeaderOffset: 0x1088
 # CHECK-NEXT:   Flags [ (0x0)
 # CHECK-NEXT:   ]
 # CHECK-NEXT:   HeaderSize: 64
 # CHECK-NEXT:   ProgramHeaderEntrySize: 56
 # CHECK-NEXT:   ProgramHeaderCount: 3
 # CHECK-NEXT:   SectionHeaderEntrySize: 64
-# CHECK-NEXT:   SectionHeaderCount: 6
-# CHECK-NEXT:   StringTableSectionIndex: 4
+# CHECK-NEXT:   SectionHeaderCount: 5
+# CHECK-NEXT:   StringTableSectionIndex: 3
 # CHECK-NEXT: }
 # CHECK-NEXT: Sections [
 # CHECK-NEXT:   Section {
@@ -69,22 +69,6 @@ _start:
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
 # CHECK-NEXT:     Index: 2
-# CHECK-NEXT:     Name: .bss
-# CHECK-NEXT:     Type: SHT_NOBITS (0x8)
-# CHECK-NEXT:     Flags [ (0x3)
-# CHECK-NEXT:       SHF_ALLOC (0x2)
-# CHECK-NEXT:       SHF_WRITE (0x1)
-# CHECK-NEXT:     ]
-# CHECK-NEXT:     Address: 0x1100C
-# CHECK-NEXT:     Offset: 0x100C
-# CHECK-NEXT:     Size: 0
-# CHECK-NEXT:     Link: 0
-# CHECK-NEXT:     Info: 0
-# CHECK-NEXT:     AddressAlignment: 0
-# CHECK-NEXT:     EntrySize: 0
-# CHECK-NEXT:   }
-# CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 3
 # CHECK-NEXT:     Name: .symtab
 # CHECK-NEXT:     Type: SHT_SYMTAB (0x2)
 # CHECK-NEXT:     Flags [ (0x0)
@@ -92,33 +76,33 @@ _start:
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x1010
 # CHECK-NEXT:     Size: 72
-# CHECK-NEXT:     Link: 5
+# CHECK-NEXT:     Link: 4
 # CHECK-NEXT:     Info: 2
 # CHECK-NEXT:     AddressAlignment: 8
 # CHECK-NEXT:     EntrySize: 24
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 4
+# CHECK-NEXT:     Index: 3
 # CHECK-NEXT:     Name: .shstrtab
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x1058
-# CHECK-NEXT:     Size: 38
+# CHECK-NEXT:     Size: 33
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0
 # CHECK-NEXT:     AddressAlignment: 1
 # CHECK-NEXT:     EntrySize: 0
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 5
-# CHECK-NEXT:     Name: .strtab (22)
+# CHECK-NEXT:     Index: 4
+# CHECK-NEXT:     Name: .strtab (17)
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
-# CHECK-NEXT:     Offset: 0x107E
+# CHECK-NEXT:     Offset: 0x1079
 # CHECK-NEXT:     Size: 13
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0

Modified: lld/trunk/test/elf2/basic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/basic.s?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/test/elf2/basic.s (original)
+++ lld/trunk/test/elf2/basic.s Tue Nov  3 15:35:14 2015
@@ -34,8 +34,8 @@ _start:
 # CHECK-NEXT:   ProgramHeaderEntrySize: 56
 # CHECK-NEXT:   ProgramHeaderCount: 3
 # CHECK-NEXT:   SectionHeaderEntrySize: 64
-# CHECK-NEXT:   SectionHeaderCount: 6
-# CHECK-NEXT:   StringTableSectionIndex: 4
+# CHECK-NEXT:   SectionHeaderCount: 5
+# CHECK-NEXT:   StringTableSectionIndex: 3
 # CHECK-NEXT: }
 # CHECK-NEXT: Sections [
 # CHECK-NEXT:   Section {
@@ -70,22 +70,6 @@ _start:
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
 # CHECK-NEXT:     Index: 2
-# CHECK-NEXT:     Name: .bss
-# CHECK-NEXT:     Type: SHT_NOBITS (0x8)
-# CHECK-NEXT:     Flags [ (0x3)
-# CHECK-NEXT:       SHF_ALLOC (0x2)
-# CHECK-NEXT:       SHF_WRITE (0x1)
-# CHECK-NEXT:     ]
-# CHECK-NEXT:     Address: 0x11010
-# CHECK-NEXT:     Offset: 0x1010
-# CHECK-NEXT:     Size: 0
-# CHECK-NEXT:     Link: 0
-# CHECK-NEXT:     Info: 0
-# CHECK-NEXT:     AddressAlignment: 0
-# CHECK-NEXT:     EntrySize: 0
-# CHECK-NEXT:   }
-# CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 3
 # CHECK-NEXT:     Name: .symtab
 # CHECK-NEXT:     Type: SHT_SYMTAB (0x2)
 # CHECK-NEXT:     Flags [ (0x0)
@@ -93,33 +77,33 @@ _start:
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x1010
 # CHECK-NEXT:     Size: 48
-# CHECK-NEXT:     Link: 5
+# CHECK-NEXT:     Link: 4
 # CHECK-NEXT:     Info: 1
 # CHECK-NEXT:     AddressAlignment: 8
 # CHECK-NEXT:     EntrySize: 24
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 4
+# CHECK-NEXT:     Index: 3
 # CHECK-NEXT:     Name: .shstrtab
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x1040
-# CHECK-NEXT:     Size: 38
+# CHECK-NEXT:     Size: 33
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0
 # CHECK-NEXT:     AddressAlignment: 1
 # CHECK-NEXT:     EntrySize: 0
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 5
-# CHECK-NEXT:     Name: .strtab (22)
+# CHECK-NEXT:     Index: 4
+# CHECK-NEXT:     Name: .strtab (17)
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
-# CHECK-NEXT:     Offset: 0x1066
+# CHECK-NEXT:     Offset: 0x1061
 # CHECK-NEXT:     Size: 8
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0

Modified: lld/trunk/test/elf2/basic32.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/basic32.s?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/test/elf2/basic32.s (original)
+++ lld/trunk/test/elf2/basic32.s Tue Nov  3 15:35:14 2015
@@ -25,15 +25,15 @@ _start:
 # CHECK-NEXT:   Version: 1
 # CHECK-NEXT:   Entry: 0x11000
 # CHECK-NEXT:   ProgramHeaderOffset: 0x34
-# CHECK-NEXT:   SectionHeaderOffset: 0x105C
+# CHECK-NEXT:   SectionHeaderOffset: 0x1058
 # CHECK-NEXT:   Flags [ (0x0)
 # CHECK-NEXT:   ]
 # CHECK-NEXT:   HeaderSize: 52
 # CHECK-NEXT:   ProgramHeaderEntrySize: 32
 # CHECK-NEXT:   ProgramHeaderCount: 3
 # CHECK-NEXT:   SectionHeaderEntrySize: 40
-# CHECK-NEXT:   SectionHeaderCount: 6
-# CHECK-NEXT:   StringTableSectionIndex: 4
+# CHECK-NEXT:   SectionHeaderCount: 5
+# CHECK-NEXT:   StringTableSectionIndex: 3
 # CHECK-NEXT: }
 # CHECK-NEXT: Sections [
 # CHECK-NEXT:   Section {
@@ -68,22 +68,6 @@ _start:
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
 # CHECK-NEXT:     Index: 2
-# CHECK-NEXT:     Name: .bss
-# CHECK-NEXT:     Type: SHT_NOBITS (0x8)
-# CHECK-NEXT:     Flags [ (0x3)
-# CHECK-NEXT:       SHF_ALLOC (0x2)
-# CHECK-NEXT:       SHF_WRITE (0x1)
-# CHECK-NEXT:     ]
-# CHECK-NEXT:     Address: 0x1100C
-# CHECK-NEXT:     Offset: 0x100C
-# CHECK-NEXT:     Size: 0
-# CHECK-NEXT:     Link: 0
-# CHECK-NEXT:     Info: 0
-# CHECK-NEXT:     AddressAlignment: 0
-# CHECK-NEXT:     EntrySize: 0
-# CHECK-NEXT:   }
-# CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 3
 # CHECK-NEXT:     Name: .symtab
 # CHECK-NEXT:     Type: SHT_SYMTAB
 # CHECK-NEXT:     Flags [
@@ -91,33 +75,33 @@ _start:
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x100C
 # CHECK-NEXT:     Size: 32
-# CHECK-NEXT:     Link: 5
+# CHECK-NEXT:     Link: 4
 # CHECK-NEXT:     Info: 1
 # CHECK-NEXT:     AddressAlignment: 4
 # CHECK-NEXT:     EntrySize: 16
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 4
+# CHECK-NEXT:     Index: 3
 # CHECK-NEXT:     Name: .shstrtab
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x102C
-# CHECK-NEXT:     Size: 38
+# CHECK-NEXT:     Size: 33
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0
 # CHECK-NEXT:     AddressAlignment: 1
 # CHECK-NEXT:     EntrySize: 0
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 5
-# CHECK-NEXT:     Name: .strtab (22)
+# CHECK-NEXT:     Index: 4
+# CHECK-NEXT:     Name: .strtab (17)
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
-# CHECK-NEXT:     Offset: 0x1052
+# CHECK-NEXT:     Offset: 0x104D
 # CHECK-NEXT:     Size: 8
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0

Modified: lld/trunk/test/elf2/basic64be.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/basic64be.s?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/test/elf2/basic64be.s (original)
+++ lld/trunk/test/elf2/basic64be.s Tue Nov  3 15:35:14 2015
@@ -45,8 +45,8 @@ _start:
 # CHECK-NEXT:   ProgramHeaderEntrySize: 56
 # CHECK-NEXT:   ProgramHeaderCount: 4
 # CHECK-NEXT:   SectionHeaderEntrySize: 64
-# CHECK-NEXT:   SectionHeaderCount: 9
-# CHECK-NEXT:   StringTableSectionIndex: 7
+# CHECK-NEXT:   SectionHeaderCount: 8
+# CHECK-NEXT:   StringTableSectionIndex: 6
 # CHECK-NEXT: }
 # CHECK-NEXT: Sections [
 # CHECK-NEXT:   Section {
@@ -145,22 +145,6 @@ _start:
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
 # CHECK-NEXT:     Index: 5
-# CHECK-NEXT:     Name: .bss
-# CHECK-NEXT:     Type: SHT_NOBITS (0x8)
-# CHECK-NEXT:     Flags [ (0x3)
-# CHECK-NEXT:       SHF_ALLOC (0x2)
-# CHECK-NEXT:       SHF_WRITE (0x1)
-# CHECK-NEXT:     ]
-# CHECK-NEXT:     Address: 0x10020058
-# CHECK-NEXT:     Offset: 0x20058
-# CHECK-NEXT:     Size: 0
-# CHECK-NEXT:     Link: 0
-# CHECK-NEXT:     Info: 0
-# CHECK-NEXT:     AddressAlignment: 0
-# CHECK-NEXT:     EntrySize: 0
-# CHECK-NEXT:   }
-# CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 6
 # CHECK-NEXT:     Name: .symtab
 # CHECK-NEXT:     Type: SHT_SYMTAB (0x2)
 # CHECK-NEXT:     Flags [ (0x0)
@@ -168,7 +152,7 @@ _start:
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x20058
 # CHECK-NEXT:     Size: 48
-# CHECK-NEXT:     Link: 8
+# CHECK-NEXT:     Link: 7
 # CHECK-NEXT:     Info: 1
 # CHECK-NEXT:     AddressAlignment: 8
 # CHECK-NEXT:     EntrySize: 24
@@ -176,14 +160,14 @@ _start:
 # CHECK:          )
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 7
+# CHECK-NEXT:     Index: 6
 # CHECK-NEXT:     Name: .shstrtab
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
 # CHECK-NEXT:     Offset: 0x20088
-# CHECK-NEXT:     Size: 54
+# CHECK-NEXT:     Size: 49
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0
 # CHECK-NEXT:     AddressAlignment: 1
@@ -192,13 +176,13 @@ _start:
 # CHECK:          )
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section {
-# CHECK-NEXT:     Index: 8
-# CHECK-NEXT:     Name: .strtab (32)
+# CHECK-NEXT:     Index: 7
+# CHECK-NEXT:     Name: .strtab (27)
 # CHECK-NEXT:     Type: SHT_STRTAB (0x3)
 # CHECK-NEXT:     Flags [ (0x0)
 # CHECK-NEXT:     ]
 # CHECK-NEXT:     Address: 0x0
-# CHECK-NEXT:     Offset: 0x200BE
+# CHECK-NEXT:     Offset: 0x200B9
 # CHECK-NEXT:     Size: 8
 # CHECK-NEXT:     Link: 0
 # CHECK-NEXT:     Info: 0

Modified: lld/trunk/test/elf2/merge-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/merge-shared.s?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/test/elf2/merge-shared.s (original)
+++ lld/trunk/test/elf2/merge-shared.s Tue Nov  3 15:35:14 2015
@@ -11,7 +11,7 @@
         .quad foo + 6
 
 
-// CHECK:      Name: foo (20)
+// CHECK:      Name: foo
 // CHECK-NEXT: Type: SHT_PROGBITS
 // CHECK-NEXT: Flags [
 // CHECK-NEXT:   SHF_ALLOC

Modified: lld/trunk/test/elf2/string-table.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/string-table.s?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/test/elf2/string-table.s (original)
+++ lld/trunk/test/elf2/string-table.s Tue Nov  3 15:35:14 2015
@@ -58,9 +58,9 @@ _start:
 // CHECK-NEXT:  AddressAlignment: 1
 // CHECK-NEXT:  EntrySize: 0
 // CHECK-NEXT:  SectionData (
-// CHECK-NEXT:    0000: 002E7465 7874002E 62737300 666F6F62  |..text..bss.foob|
-// CHECK-NEXT:    0010: 6172002E 73687374 72746162 002E7374  |ar..shstrtab..st|
-// CHECK-NEXT:    0020: 72746162 002E7379 6D746162 00        |rtab..symtab.|
+// CHECK-NEXT:    0000: 002E7465 78740066 6F6F6261 72002E73  |..text.foobar..s|
+// CHECK-NEXT:    0010: 68737472 74616200 2E737472 74616200  |hstrtab..strtab.|
+// CHECK-NEXT:    0020: 2E73796D 74616200                    |.symtab.|
 // CHECK-NEXT:  )
 // CHECK-NEXT:}
 // CHECK:        Name: .strtab

Modified: lld/trunk/test/elf2/tls.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/tls.s?rev=251980&r1=251979&r2=251980&view=diff
==============================================================================
--- lld/trunk/test/elf2/tls.s (original)
+++ lld/trunk/test/elf2/tls.s Tue Nov  3 15:35:14 2015
@@ -87,15 +87,6 @@ _start:
 // CHECK-NEXT:     AddressAlignment:
 // CHECK-NEXT:     EntrySize:
 // CHECK-NEXT:   }
-// CHECK-NEXT:   Section {
-// CHECK-NEXT:     Index:
-// CHECK-NEXT:     Name:
-// CHECK-NEXT:     Type:
-// CHECK-NEXT:     Flags [
-// CHECK-NEXT:       SHF_ALLOC
-// CHECK-NEXT:       SHF_WRITE
-// CHECK-NEXT:     ]
-// CHECK-NEXT:     Address: [[TBSS_ADDR]]
 
 // Check that the TLS NOBITS sections weren't added to the R/W PT_LOAD's size.
 




More information about the llvm-commits mailing list