[lld] r253970 - Revert r253967 which broke buildbot.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 02:04:25 PST 2015


Author: grimar
Date: Tue Nov 24 04:04:22 2015
New Revision: 253970

URL: http://llvm.org/viewvc/llvm-project?rev=253970&view=rev
Log:
Revert r253967 which broke buildbot.


Removed:
    lld/trunk/test/ELF/relro.s
Modified:
    lld/trunk/ELF/Config.h
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/Writer.cpp
    lld/trunk/test/ELF/eh-frame-merge.s
    lld/trunk/test/ELF/gnu-hash-table.s
    lld/trunk/test/ELF/got-aarch64.s
    lld/trunk/test/ELF/merge-shared.s
    lld/trunk/test/ELF/merge-string.s
    lld/trunk/test/ELF/merge-sym.s
    lld/trunk/test/ELF/mips-dynamic.s
    lld/trunk/test/ELF/mips-got-relocs.s
    lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s
    lld/trunk/test/ELF/relative-dynamic-reloc.s
    lld/trunk/test/ELF/relocation.s
    lld/trunk/test/ELF/section-name.s
    lld/trunk/test/ELF/shared.s

Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Tue Nov 24 04:04:22 2015
@@ -67,7 +67,6 @@ struct Configuration {
   bool ZNodelete;
   bool ZNow;
   bool ZOrigin;
-  bool ZRelro;
   ELFKind EKind = ELFNoneKind;
   uint16_t EMachine = llvm::ELF::EM_NONE;
   uint64_t EntryAddr = -1;

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Nov 24 04:04:22 2015
@@ -176,7 +176,6 @@ void LinkerDriver::createFiles(opt::Inpu
   Config->ZNodelete = hasZOption(Args, "nodelete");
   Config->ZNow = hasZOption(Args, "now");
   Config->ZOrigin = hasZOption(Args, "origin");
-  Config->ZRelro = !hasZOption(Args, "norelro");
 
   if (auto *Arg = Args.getLastArg(OPT_O)) {
     StringRef Val = Arg->getValue();

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Nov 24 04:04:22 2015
@@ -47,8 +47,6 @@ private:
                   iterator_range<const Elf_Rel_Impl<ELFT, isRela> *> Rels);
   void scanRelocs(InputSection<ELFT> &C);
   void scanRelocs(InputSectionBase<ELFT> &S, const Elf_Shdr &RelSec);
-  void updateRelro(Elf_Phdr *Cur, Elf_Phdr *GnuRelroPhdr,
-                   OutputSectionBase<ELFT> *Sec, uintX_t VA);
   void assignAddresses();
   void buildSectionMap();
   void openFile(StringRef OutputPath);
@@ -83,7 +81,6 @@ private:
                uintX_t VA, uintX_t Size, uintX_t Align);
   void copyPhdr(Elf_Phdr *PH, OutputSectionBase<ELFT> *From);
 
-  bool HasRelro = false;
   SymbolTable<ELFT> &Symtab;
   std::vector<Elf_Phdr> Phdrs;
 
@@ -356,26 +353,6 @@ static int getPPC64SectionRank(StringRef
            .Default(1);
 }
 
-template <class ELFT> static bool isRelroSection(OutputSectionBase<ELFT> *Sec) {
-  OutputSectionBase<ELFT>::uintX_t Flags = Sec->getFlags();
-  if (!(Flags & SHF_ALLOC) || !(Flags & SHF_WRITE))
-    return false;
-  uint32_t Type = Sec->getType();
-  if ((Flags & SHF_TLS) || (Type == SHT_INIT_ARRAY || Type == SHT_FINI_ARRAY ||
-                            Type == SHT_PREINIT_ARRAY))
-    return true;
-  if (Sec == Out<ELFT>::GotPlt)
-    return Config->ZNow;
-  if (Sec == Out<ELFT>::Dynamic || Sec == Out<ELFT>::Got)
-    return true;
-
-  StringRef Name = Sec->getName();
-  StringRef WhiteList[] = {".data.rel.ro", ".ctors", ".dtors", ".jcr",
-                           ".eh_frame"};
-  return (std::find(std::begin(WhiteList), std::end(WhiteList), Name) !=
-          std::end(WhiteList));
-}
-
 // Output section ordering is determined by this function.
 template <class ELFT>
 static bool compareOutputSections(OutputSectionBase<ELFT> *A,
@@ -432,12 +409,6 @@ static bool compareOutputSections(Output
   if (AIsNoBits != BIsNoBits)
     return BIsNoBits;
 
-  // We place RelRo section before plain r/w ones.
-  bool AIsRelRo = isRelroSection(A);
-  bool BIsRelRo = isRelroSection(B);
-  if (AIsRelRo != BIsRelRo)
-    return AIsRelRo;
-
   // Some architectures have additional ordering restrictions for sections
   // within the same PT_LOAD.
   if (Config->EMachine == EM_PPC64)
@@ -753,10 +724,8 @@ template <class ELFT> void Writer<ELFT>:
   std::stable_sort(OutputSections.begin(), OutputSections.end(),
                    compareSections<ELFT>);
 
-  for (unsigned I = 0, N = OutputSections.size(); I < N; ++I) {
+  for (unsigned I = 0, N = OutputSections.size(); I < N; ++I)
     OutputSections[I]->SectionIndex = I + 1;
-    HasRelro |= (Config->ZRelro && isRelroSection(OutputSections[I]));
-  }
 
   for (OutputSectionBase<ELFT> *Sec : OutputSections)
     Out<ELFT>::ShStrTab->add(Sec->getName());
@@ -824,18 +793,6 @@ static uint32_t toPhdrFlags(uint64_t Fla
   return Ret;
 }
 
-template <class ELFT>
-void Writer<ELFT>::updateRelro(Elf_Phdr *Cur, Elf_Phdr *GnuRelroPhdr,
-                               OutputSectionBase<ELFT> *Sec, uintX_t VA) {
-  if (!Config->ZRelro || !(Cur->p_flags & PF_W) || !isRelroSection(Sec))
-    return;
-  if (!GnuRelroPhdr->p_type)
-    setPhdr(GnuRelroPhdr, PT_GNU_RELRO, PF_R, Cur->p_offset, Cur->p_vaddr,
-            VA - Cur->p_vaddr, 1 /*p_align*/);
-  GnuRelroPhdr->p_filesz = VA - Cur->p_vaddr;
-  GnuRelroPhdr->p_memsz = VA - Cur->p_vaddr;
-}
-
 // Visits all sections to create PHDRs and to assign incremental,
 // non-overlapping addresses to output sections.
 template <class ELFT> void Writer<ELFT>::assignAddresses() {
@@ -862,7 +819,6 @@ template <class ELFT> void Writer<ELFT>:
   setPhdr(&Phdrs[++PhdrIdx], PT_LOAD, PF_R, 0, Target->getVAStart(), FileOff,
           Target->getPageSize());
 
-  Elf_Phdr GnuRelroPhdr = {};
   Elf_Phdr TlsPhdr{};
   uintX_t ThreadBSSOffset = 0;
   // Create phdrs as we assign VAs and file offsets to all output sections.
@@ -896,7 +852,6 @@ template <class ELFT> void Writer<ELFT>:
         VA = RoundUpToAlignment(VA, Sec->getAlign());
         Sec->setVA(VA);
         VA += Sec->getSize();
-        updateRelro(&Phdrs[PhdrIdx], &GnuRelroPhdr, Sec, VA);
       }
     }
 
@@ -926,11 +881,6 @@ template <class ELFT> void Writer<ELFT>:
     copyPhdr(PH, Out<ELFT>::Dynamic);
   }
 
-  if (HasRelro) {
-    Elf_Phdr *PH = &Phdrs[++PhdrIdx];
-    *PH = GnuRelroPhdr;
-  }
-
   // PT_GNU_STACK is a special section to tell the loader to make the
   // pages for the stack non-executable.
   if (!Config->ZExecStack) {
@@ -982,8 +932,6 @@ template <class ELFT> int Writer<ELFT>::
   }
   if (Tls)
     ++I;
-  if (HasRelro)
-    ++I;
   return I;
 }
 

Modified: lld/trunk/test/ELF/eh-frame-merge.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-merge.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-merge.s (original)
+++ lld/trunk/test/ELF/eh-frame-merge.s Tue Nov 24 04:04:22 2015
@@ -35,9 +35,9 @@
 // CHECK-NEXT: SectionData (
 // CHECK-NEXT:   0000: 14000000 00000000 017A5200 01781001  |
 // CHECK-NEXT:   0010: 1B0C0708 90010000 10000000 1C000000  |
-// CHECK-NEXT:   0020: 500E0000 01000000 00000000 10000000  |
-// CHECK-NEXT:   0030: 30000000 3E0E0000 02000000 00000000  |
-// CHECK-NEXT:   0040: 10000000 44000000 290E0000 01000000  |
+// CHECK-NEXT:   0020: 880E0000 01000000 00000000 10000000  |
+// CHECK-NEXT:   0030: 30000000 760E0000 02000000 00000000  |
+// CHECK-NEXT:   0040: 10000000 44000000 610E0000 01000000  |
 // CHECK-NEXT:   0050: 00000000                             |
 // CHECK-NEXT: )
 

Modified: lld/trunk/test/ELF/gnu-hash-table.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gnu-hash-table.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/gnu-hash-table.s (original)
+++ lld/trunk/test/ELF/gnu-hash-table.s Tue Nov 24 04:04:22 2015
@@ -149,8 +149,8 @@
 # PPC64-NEXT:     Flags [
 # PPC64-NEXT:       SHF_ALLOC
 # PPC64-NEXT:     ]
-# PPC64-NEXT:     Address: 0x1F0
-# PPC64-NEXT:     Offset: 0x1F0
+# PPC64-NEXT:     Address: 0x1B8
+# PPC64-NEXT:     Offset: 0x1B8
 # PPC64-NEXT:     Size: 36
 # PPC64-NEXT:     Link: 1
 # PPC64-NEXT:     Info: 0

Modified: lld/trunk/test/ELF/got-aarch64.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/got-aarch64.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/got-aarch64.s (original)
+++ lld/trunk/test/ELF/got-aarch64.s Tue Nov 24 04:04:22 2015
@@ -10,7 +10,7 @@
 // CHECK-NEXT:   SHF_ALLOC
 // CHECK-NEXT:   SHF_WRITE
 // CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x2090
+// CHECK-NEXT: Address: 0x2098
 // CHECK-NEXT: Offset:
 // CHECK-NEXT: Size: 8
 // CHECK-NEXT: Link: 0
@@ -19,7 +19,7 @@
 
 // CHECK:      Relocations [
 // CHECK-NEXT:   Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT:     0x2090 R_AARCH64_GLOB_DAT dat 0x0
+// CHECK-NEXT:     0x2098 R_AARCH64_GLOB_DAT dat 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
 
@@ -28,7 +28,7 @@
 
 // DISASM: main:
 // DISASM-NEXT:     1000: {{.*}} adrp x0, #4096
-// DISASM-NEXT:     1004: {{.*}} ldr x0, [x0, #144]
+// DISASM-NEXT:     1004: {{.*}} ldr x0, [x0, #152]
 
 .global main,foo,dat
 .text

Modified: lld/trunk/test/ELF/merge-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-shared.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-shared.s (original)
+++ lld/trunk/test/ELF/merge-shared.s Tue Nov 24 04:04:22 2015
@@ -17,10 +17,10 @@
 // CHECK-NEXT:   SHF_ALLOC
 // CHECK-NEXT:   SHF_MERGE
 // CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x190
+// CHECK-NEXT: Address: 0x158
 
 // CHECK:      Relocations [
 // CHECK-NEXT:   Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT:     0x{{.*}} R_X86_64_RELATIVE - 0x192
+// CHECK-NEXT:     0x{{.*}} R_X86_64_RELATIVE - 0x15A
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: lld/trunk/test/ELF/merge-string.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-string.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-string.s (original)
+++ lld/trunk/test/ELF/merge-string.s Tue Nov 24 04:04:22 2015
@@ -26,8 +26,8 @@ zed:
 // CHECK-NEXT:   SHF_MERGE
 // CHECK-NEXT:   SHF_STRINGS
 // CHECK-NEXT: ]
-// CHECK-NEXT: Address:         0x190
-// CHECK-NEXT: Offset:  0x190
+// CHECK-NEXT: Address:         0x158
+// CHECK-NEXT: Offset:  0x158
 // CHECK-NEXT: Size:    4
 // CHECK-NEXT: Link: 0
 // CHECK-NEXT: Info: 0
@@ -44,8 +44,8 @@ zed:
 // NOTAIL-NEXT:   SHF_MERGE
 // NOTAIL-NEXT:   SHF_STRINGS
 // NOTAIL-NEXT: ]
-// NOTAIL-NEXT: Address:         0x190
-// NOTAIL-NEXT: Offset:  0x190
+// NOTAIL-NEXT: Address:         0x158
+// NOTAIL-NEXT: Offset:  0x158
 // NOTAIL-NEXT: Size:    7
 // NOTAIL-NEXT: Link: 0
 // NOTAIL-NEXT: Info: 0
@@ -62,8 +62,8 @@ zed:
 // CHECK-NEXT:   SHF_MERGE
 // CHECK-NEXT:   SHF_STRINGS
 // CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x194
-// CHECK-NEXT: Offset: 0x194
+// CHECK-NEXT: Address: 0x15C
+// CHECK-NEXT: Offset: 0x15C
 // CHECK-NEXT: Size: 4
 // CHECK-NEXT: Link: 0
 // CHECK-NEXT: Info: 0
@@ -75,11 +75,11 @@ zed:
 
 
 // CHECK:      Name:    bar
-// CHECK-NEXT: Value:   0x191
+// CHECK-NEXT: Value:   0x159
 
 // CHECK:      Name:    foo
-// CHECK-NEXT: Value:   0x190
+// CHECK-NEXT: Value:   0x158
 
 // CHECK:      Name: zed
-// CHECK-NEXT: Value: 0x194
+// CHECK-NEXT: Value: 0x15C
 // CHECK-NEXT: Size: 0

Modified: lld/trunk/test/ELF/merge-sym.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-sym.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-sym.s (original)
+++ lld/trunk/test/ELF/merge-sym.s Tue Nov 24 04:04:22 2015
@@ -15,7 +15,7 @@ foo:
 // CHECK-NEXT:   SHF_ALLOC
 // CHECK-NEXT:   SHF_MERGE
 // CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x190
+// CHECK-NEXT: Address: 0x158
 
 // CHECK:      Name: foo
-// CHECK-NEXT: Value: 0x192
+// CHECK-NEXT: Value: 0x15A

Modified: lld/trunk/test/ELF/mips-dynamic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-dynamic.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-dynamic.s (original)
+++ lld/trunk/test/ELF/mips-dynamic.s Tue Nov 24 04:04:22 2015
@@ -20,24 +20,24 @@
 # EXE-NEXT:     Flags [
 # EXE-NEXT:       SHF_ALLOC
 # EXE-NEXT:     ]
-# EXE:          Name: .got
+# EXE:          Name: .rld_map
 # EXE-NEXT:     Type: SHT_PROGBITS
-# EXE-NEXT:     Flags [ (0x10000003)
+# EXE-NEXT:     Flags [
 # EXE-NEXT:       SHF_ALLOC
 # EXE-NEXT:       SHF_WRITE
 # EXE-NEXT:     ]
-# EXE-NEXT:     Address: [[GOTADDR:0x[0-9a-f]+]]
+# EXE-NEXT:     Address: [[RLDMAPADDR:0x[0-9a-f]+]]
 # EXE-NEXT:     Offset:
-# EXE-NEXT:     Size: 8
-# EXE:          Name: .rld_map
+# EXE-NEXT:     Size: 4
+# EXE:          Name: .got
 # EXE-NEXT:     Type: SHT_PROGBITS
-# EXE-NEXT:     Flags [
+# EXE-NEXT:     Flags [ (0x10000003)
 # EXE-NEXT:       SHF_ALLOC
 # EXE-NEXT:       SHF_WRITE
 # EXE-NEXT:     ]
-# EXE-NEXT:     Address: [[RLDMAPADDR:0x[0-9a-f]+]]
+# EXE-NEXT:     Address: [[GOTADDR:0x[0-9a-f]+]]
 # EXE-NEXT:     Offset:
-# EXE-NEXT:     Size: 4
+# EXE-NEXT:     Size: 8
 # EXE:      ]
 # EXE:      DynamicSection [
 # EXE-NEXT:   Tag        Type                 Name/Value

Modified: lld/trunk/test/ELF/mips-got-relocs.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-got-relocs.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-got-relocs.s (original)
+++ lld/trunk/test/ELF/mips-got-relocs.s Tue Nov 24 04:04:22 2015
@@ -45,21 +45,21 @@ v1:
   .word 0
 
 # EXE_SYM: Sections:
-# EXE_SYM: .got 0000000c 0000000000030000 DATA
+# EXE_SYM: .got 0000000c 0000000000030004 DATA
 # EXE_SYM: SYMBOL TABLE:
-# EXE_SYM: 00037ff0         *ABS*		 00000000 _gp
+# EXE_SYM: 00037ff4         *ABS*		 00000000 _gp
 #          ^-- .got + GP offset (0x7ff0)
-# EXE_SYM: 00030010 g       .data		 00000004 v1
+# EXE_SYM: 00030000 g       .data		 00000004 v1
 
 # EXE_GOT_BE: Contents of section .got:
-# EXE_GOT_BE:  30000 00000000 80000000 00030010
-#                    ^        ^        ^-- v1 (0x30010)
+# EXE_GOT_BE:  30004 00000000 80000000 00030000
+#                    ^        ^        ^-- v1 (0x30000)
 #                    |        +-- Module pointer (0x80000000)
 #                    +-- Lazy resolver (0x0)
 
 # EXE_GOT_EL: Contents of section .got:
-# EXE_GOT_EL:  30000 00000000 00000080 10000300
-#                    ^        ^        ^-- v1 (0x30010)
+# EXE_GOT_EL:  30004 00000000 00000080 00000300
+#                    ^        ^        ^-- v1 (0x30000)
 #                    |        +-- Module pointer (0x80000000)
 #                    +-- Lazy resolver (0x0)
 
@@ -68,21 +68,21 @@ v1:
 # EXE_DIS_EL:  20000:  18 80 02 3c  lui $2, 32792
 
 # DSO_SYM: Sections:
-# DSO_SYM: .got 0000000c 0000000000020000 DATA
+# DSO_SYM: .got 0000000c 0000000000020004 DATA
 # DSO_SYM: SYMBOL TABLE:
-# DSO_SYM: 00027ff0         *ABS*		 00000000 _gp
+# DSO_SYM: 00027ff4         *ABS*		 00000000 _gp
 #          ^-- .got + GP offset (0x7ff0)
-# DSO_SYM: 00020010 g       .data		 00000004 v1
+# DSO_SYM: 00020000 g       .data		 00000004 v1
 
 # DSO_GOT_BE: Contents of section .got:
-# DSO_GOT_BE:  20000 00000000 80000000 00020010
-#                    ^        ^        ^-- v1 (0x20010)
+# DSO_GOT_BE:  20004 00000000 80000000 00020000
+#                    ^        ^        ^-- v1 (0x20000)
 #                    |        +-- Module pointer (0x80000000)
 #                    +-- Lazy resolver (0x0)
 
 # DSO_GOT_EL: Contents of section .got:
-# DSO_GOT_EL:  20000 00000000 00000080 10000200
-#                    ^        ^        ^-- v1 (0x20010)
+# DSO_GOT_EL:  20004 00000000 00000080 00000200
+#                    ^        ^        ^-- v1 (0x20000)
 #                    |        +-- Module pointer (0x80000000)
 #                    +-- Lazy resolver (0x0)
 

Modified: lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s (original)
+++ lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s Tue Nov 24 04:04:22 2015
@@ -13,7 +13,7 @@
 // CHECK-NEXT:     0x10010 R_PPC64_RELATIVE - 0x10009
 // CHECK-NEXT:     0x{{.*}} R_PPC64_RELATIVE - 0x[[ZED_ADDR:.*]]
 // CHECK-NEXT:     0x{{.*}} R_PPC64_RELATIVE - 0x[[FOO_ADDR]]
-// CHECK-NEXT:     0x198 R_PPC64_ADDR64 external 0x0
+// CHECK-NEXT:     0x160 R_PPC64_ADDR64 external 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
 

Modified: lld/trunk/test/ELF/relative-dynamic-reloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relative-dynamic-reloc.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/relative-dynamic-reloc.s (original)
+++ lld/trunk/test/ELF/relative-dynamic-reloc.s Tue Nov 24 04:04:22 2015
@@ -12,7 +12,7 @@
 // CHECK-NEXT:     0x1010 R_X86_64_RELATIVE - 0x1009
 // CHECK-NEXT:     0x{{.*}} R_X86_64_RELATIVE - 0x[[ZED_ADDR:.*]]
 // CHECK-NEXT:     0x{{.*}} R_X86_64_RELATIVE - 0x[[FOO_ADDR]]
-// CHECK-NEXT:     0x198 R_X86_64_64 external 0x0
+// CHECK-NEXT:     0x160 R_X86_64_64 external 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
 

Modified: lld/trunk/test/ELF/relocation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocation.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/relocation.s (original)
+++ lld/trunk/test/ELF/relocation.s Tue Nov 24 04:04:22 2015
@@ -104,7 +104,7 @@ R_X86_64_64:
  .quad R_X86_64_64
 
 // CHECK:      Contents of section .R_X86_64_64:
-// CHECK-NEXT:   10190 90010100 00000000
+// CHECK-NEXT:   10158 58010100 00000000
 
 .section .R_X86_64_GOTPCREL,"a", at progbits
 .global R_X86_64_GOTPCREL
@@ -114,4 +114,4 @@ R_X86_64_GOTPCREL:
 // 0x120A8 - 0x10160 = 8008
 // 8008 = 0x481f0000   in little endian
 // CHECK:      Contents of section .R_X86_64_GOTPCREL
-// CHECK-NEXT:   10198 481f0000
+// CHECK-NEXT:   10160 801f0000

Removed: lld/trunk/test/ELF/relro.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relro.s?rev=253969&view=auto
==============================================================================
--- lld/trunk/test/ELF/relro.s (original)
+++ lld/trunk/test/ELF/relro.s (removed)
@@ -1,243 +0,0 @@
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t2.o
-// RUN: ld.lld -shared %t2.o -o %t2.so
-// RUN: ld.lld %t.o %t2.so -z now -z relro -o %t
-// RUN: llvm-readobj --program-headers --dynamic-table -t -s -dyn-symbols -section-data %t | FileCheck --check-prefix=FULLRELRO %s
-// RUN: ld.lld %t.o %t2.so -z relro -o %t
-// RUN: llvm-readobj --program-headers --dynamic-table -t -s -dyn-symbols -section-data %t | FileCheck --check-prefix=PARTRELRO %s
-// RUN: ld.lld %t.o %t2.so -z norelro -o %t
-// RUN: llvm-readobj --program-headers --dynamic-table -t -s -dyn-symbols -section-data %t | FileCheck --check-prefix=NORELRO %s
-// REQUIRES: x86
-
-// FULLRELRO:        Section {
-// FULLRELRO:        Index: 9
-// FULLRELRO-NEXT:   Name: .got
-// FULLRELRO-NEXT:   Type: SHT_PROGBITS
-// FULLRELRO-NEXT:   Flags [
-// FULLRELRO-NEXT:     SHF_ALLOC
-// FULLRELRO-NEXT:     SHF_WRITE
-// FULLRELRO-NEXT:   ]
-// FULLRELRO-NEXT:   Address: 0x12100
-// FULLRELRO-NEXT:   Offset: 0x2100
-// FULLRELRO-NEXT:   Size: 8
-// FULLRELRO-NEXT:   Link: 0
-// FULLRELRO-NEXT:   Info: 0
-// FULLRELRO-NEXT:   AddressAlignment: 8
-// FULLRELRO-NEXT:   EntrySize: 0
-// FULLRELRO-NEXT:   SectionData (
-// FULLRELRO-NEXT:     0000: 00000000 00000000
-// FULLRELRO-NEXT:   )
-// FULLRELRO-NEXT: }
-// FULLRELRO-NEXT: Section {
-// FULLRELRO-NEXT:   Index: 10
-// FULLRELRO-NEXT:   Name: .got.plt
-// FULLRELRO-NEXT:   Type: SHT_PROGBITS
-// FULLRELRO-NEXT:   Flags [
-// FULLRELRO-NEXT:     SHF_ALLOC
-// FULLRELRO-NEXT:     SHF_WRITE
-// FULLRELRO-NEXT:   ]
-// FULLRELRO-NEXT:   Address: 0x12108
-// FULLRELRO-NEXT:   Offset: 0x2108
-// FULLRELRO-NEXT:   Size: 32
-// FULLRELRO-NEXT:   Link: 0
-// FULLRELRO-NEXT:   Info: 0
-// FULLRELRO-NEXT:   AddressAlignment: 8
-// FULLRELRO-NEXT:   EntrySize: 0
-// FULLRELRO-NEXT:   SectionData (
-// FULLRELRO-NEXT:     0000:
-// FULLRELRO-NEXT:     0010:
-// FULLRELRO-NEXT:   )
-// FULLRELRO-NEXT: }
-// FULLRELRO-NEXT: Section {
-// FULLRELRO-NEXT:   Index: 11
-// FULLRELRO-NEXT:   Name: .data
-// FULLRELRO-NEXT:   Type: SHT_PROGBITS
-// FULLRELRO-NEXT:   Flags [
-// FULLRELRO-NEXT:     SHF_ALLOC
-// FULLRELRO-NEXT:     SHF_WRITE
-// FULLRELRO-NEXT:   ]
-// FULLRELRO-NEXT:   Address: 0x12128
-// FULLRELRO-NEXT:   Offset: 0x2128
-// FULLRELRO-NEXT:   Size: 12
-// FULLRELRO-NEXT:   Link: 0
-// FULLRELRO-NEXT:   Info: 0
-// FULLRELRO-NEXT:   AddressAlignment:
-// FULLRELRO-NEXT:   EntrySize: 0
-// FULLRELRO-NEXT:   SectionData (
-// FULLRELRO-NEXT:     0000:
-// FULLRELRO-NEXT:   )
-// FULLRELRO-NEXT: }
-// FULLRELRO-NEXT: Section {
-// FULLRELRO-NEXT:   Index: 12
-// FULLRELRO-NEXT:   Name: .foo
-// FULLRELRO-NEXT:   Type: SHT_PROGBITS
-// FULLRELRO-NEXT:   Flags [
-// FULLRELRO-NEXT:     SHF_ALLOC
-// FULLRELRO-NEXT:     SHF_WRITE
-// FULLRELRO-NEXT:   ]
-// FULLRELRO-NEXT:   Address: 0x12134
-// FULLRELRO-NEXT:   Offset: 0x2134
-// FULLRELRO-NEXT:   Size: 0
-// FULLRELRO-NEXT:   Link: 0
-// FULLRELRO-NEXT:   Info: 0
-// FULLRELRO-NEXT:   AddressAlignment:
-// FULLRELRO-NEXT:   EntrySize: 0
-// FULLRELRO-NEXT:   SectionData (
-// FULLRELRO-NEXT:   )
-// FULLRELRO-NEXT: }
-// 308 - sizeof(.data)(12) = 296
-// FULLRELRO:       ProgramHeaders [
-// FULLRELRO:       Type: PT_LOAD
-// FULLRELRO:       Offset: 0x2000
-// FULLRELRO-NEXT:  VirtualAddress: [[RWADDR:.*]]
-// FULLRELRO-NEXT:  PhysicalAddress:
-// FULLRELRO-NEXT:  FileSize: 308
-// FULLRELRO-NEXT:  MemSize: 308
-// FULLRELRO-NEXT:  Flags [
-// FULLRELRO-NEXT:    PF_R
-// FULLRELRO-NEXT:    PF_W
-// FULLRELRO-NEXT:  ]
-// FULLRELRO-NEXT:  Alignment: 4096
-// FULLRELRO-NEXT:}
-// FULLRELRO:       Type: PT_GNU_RELRO
-// FULLRELRO-NEXT:  Offset: 0x
-// FULLRELRO-NEXT:  VirtualAddress: [[RWADDR]]
-// FULLRELRO-NEXT:  PhysicalAddress:
-// FULLRELRO-NEXT:  FileSize: 296
-// FULLRELRO-NEXT:  MemSize: 296
-// FULLRELRO-NEXT:  Flags [
-// FULLRELRO-NEXT:    PF_R
-// FULLRELRO-NEXT:  ]
-// FULLRELRO-NEXT:  Alignment: 1
-// FULLRELRO-NEXT:}
-
-// PARTRELRO:       Section {
-// PARTRELRO:       Index: 9
-// PARTRELRO-NEXT:  Name: .got
-// PARTRELRO-NEXT:  Type: SHT_PROGBITS
-// PARTRELRO-NEXT:  Flags [
-// PARTRELRO-NEXT:    SHF_ALLOC
-// PARTRELRO-NEXT:    SHF_WRITE
-// PARTRELRO-NEXT:  ]
-// PARTRELRO-NEXT:  Address: 0x120E0
-// PARTRELRO-NEXT:  Offset: 0x20E0
-// PARTRELRO-NEXT:  Size: 8
-// PARTRELRO-NEXT:  Link: 0
-// PARTRELRO-NEXT:  Info: 0
-// PARTRELRO-NEXT:  AddressAlignment: 8
-// PARTRELRO-NEXT:  EntrySize: 0
-// PARTRELRO-NEXT:  SectionData (
-// PARTRELRO-NEXT:    0000:
-// PARTRELRO-NEXT:  )
-// PARTRELRO-NEXT:  }
-// PARTRELRO-NEXT:  Section {
-// PARTRELRO-NEXT:  Index: 10
-// PARTRELRO-NEXT:  Name: .data
-// PARTRELRO-NEXT:  Type: SHT_PROGBITS
-// PARTRELRO-NEXT:  Flags [
-// PARTRELRO-NEXT:    SHF_ALLOC
-// PARTRELRO-NEXT:    SHF_WRITE
-// PARTRELRO-NEXT:  ]
-// PARTRELRO-NEXT:  Address: 0x120E8
-// PARTRELRO-NEXT:  Offset: 0x20E8
-// PARTRELRO-NEXT:  Size: 12
-// PARTRELRO-NEXT:  Link: 0
-// PARTRELRO-NEXT:  Info: 0
-// PARTRELRO-NEXT:  AddressAlignment: 1
-// PARTRELRO-NEXT:  EntrySize: 0
-// PARTRELRO-NEXT:  SectionData (
-// PARTRELRO-NEXT:    0000:
-// PARTRELRO-NEXT:  )
-// PARTRELRO-NEXT:  }
-// PARTRELRO-NEXT:  Section {
-// PARTRELRO-NEXT:    Index: 11
-// PARTRELRO-NEXT:    Name: .foo
-// PARTRELRO-NEXT:    Type: SHT_PROGBITS
-// PARTRELRO-NEXT:    Flags [
-// PARTRELRO-NEXT:      SHF_ALLOC
-// PARTRELRO-NEXT:      SHF_WRITE
-// PARTRELRO-NEXT:    ]
-// PARTRELRO-NEXT:    Address: 0x120F4
-// PARTRELRO-NEXT:    Offset: 0x20F4
-// PARTRELRO-NEXT:    Size: 0
-// PARTRELRO-NEXT:    Link: 0
-// PARTRELRO-NEXT:    Info: 0
-// PARTRELRO-NEXT:    AddressAlignment: 1
-// PARTRELRO-NEXT:    EntrySize: 0
-// PARTRELRO-NEXT:    SectionData (
-// PARTRELRO-NEXT:    )
-// PARTRELRO-NEXT:  }
-// PARTRELRO-NEXT:  Section {
-// PARTRELRO-NEXT:    Index: 12
-// PARTRELRO-NEXT:    Name: .got.plt
-// PARTRELRO-NEXT:    Type: SHT_PROGBITS
-// PARTRELRO-NEXT:    Flags [
-// PARTRELRO-NEXT:      SHF_ALLOC
-// PARTRELRO-NEXT:      SHF_WRITE
-// PARTRELRO-NEXT:    ]
-// PARTRELRO-NEXT:    Address: 0x120F8
-// PARTRELRO-NEXT:    Offset: 0x20F8
-// PARTRELRO-NEXT:    Size: 32
-// PARTRELRO-NEXT:    Link: 0
-// PARTRELRO-NEXT:    Info: 0
-// PARTRELRO-NEXT:    AddressAlignment: 8
-// PARTRELRO-NEXT:    EntrySize: 0
-// PARTRELRO-NEXT:    SectionData (
-// PARTRELRO-NEXT:      0000:
-// PARTRELRO-NEXT:      0010:
-// PARTRELRO-NEXT:    )
-// PARTRELRO-NEXT:  }
-// PARTRELRO-NEXT:  Section {
-// PARTRELRO-NEXT:    Index: 13
-// PARTRELRO-NEXT:    Name: .bss
-// PARTRELRO-NEXT:    Type: SHT_NOBITS
-// PARTRELRO-NEXT:    Flags [
-// PARTRELRO-NEXT:      SHF_ALLOC
-// PARTRELRO-NEXT:      SHF_WRITE
-// PARTRELRO-NEXT:    ]
-// PARTRELRO-NEXT:    Address: 0x12118
-// PARTRELRO-NEXT:    Offset: 0x2118
-// PARTRELRO-NEXT:    Size: 0
-// PARTRELRO-NEXT:    Link: 0
-// PARTRELRO-NEXT:    Info: 0
-// PARTRELRO-NEXT:    AddressAlignment: 1
-// PARTRELRO-NEXT:    EntrySize: 0
-// PARTRELRO-NEXT:  }
-// 232 + sizeof(.data)(12) + align(4) + sizeof(.got.plt)(32) = 280
-// PARTRELRO:       ProgramHeader {
-// PARTRELRO:       Type: PT_LOAD
-// PARTRELRO:       Offset: 0x2000
-// PARTRELRO-NEXT:  VirtualAddress: [[RWADDR:.*]]
-// PARTRELRO-NEXT:  PhysicalAddress:
-// PARTRELRO-NEXT:  FileSize: 280
-// PARTRELRO-NEXT:  MemSize: 280
-// PARTRELRO-NEXT:  Flags [
-// PARTRELRO-NEXT:    PF_R (0x4)
-// PARTRELRO-NEXT:    PF_W (0x2)
-// PARTRELRO-NEXT:  ]
-// PARTRELRO-NEXT:  Alignment: 4096
-// PARTRELRO:       Type: PT_GNU_RELRO
-// PARTRELRO-NEXT:  Offset: 0x2000
-// PARTRELRO-NEXT:  VirtualAddress: [[RWADDR]]
-// PARTRELRO-NEXT:  PhysicalAddress:
-// PARTRELRO-NEXT:  FileSize: 232
-// PARTRELRO-NEXT:  MemSize: 232
-// PARTRELRO-NEXT:  Flags [
-// PARTRELRO-NEXT:    PF_R
-// PARTRELRO-NEXT:  ]
-// PARTRELRO-NEXT:  Alignment: 1
-
-// NORELRO:     ProgramHeaders [
-// NORELRO-NOT: PT_GNU_RELRO
-
-.global _start
-_start:
-  .long bar
-  jmp *bar at GOTPCREL(%rip)
-
-.section .data,"aw"
-.quad 0
-
-.zero 4
-.section .foo,"aw"
-.section .bss,"", at nobits

Modified: lld/trunk/test/ELF/section-name.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/section-name.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/section-name.s (original)
+++ lld/trunk/test/ELF/section-name.s Tue Nov 24 04:04:22 2015
@@ -26,12 +26,12 @@ _start:
 // CHECK:     Name: .rodata
 // CHECK-NOT: Name: .text.a
 // CHECK:     Name: .text
-// CHECK-NOT: Name: .data.rel.ro.a
-// CHECK-NOT: Name: .data.rel.ro.local.a
-// CHECK:     Name: .data.rel.ro
 // CHECK-NOT: Name: .data.a
 // CHECK:     Name: .data
 // CHECK:     Name: .foo.a
 // CHECK:     Name: .foo
+// CHECK-NOT: Name: .data.rel.ro.a
+// CHECK-NOT: Name: .data.rel.ro.local.a
+// CHECK:     Name: .data.rel.ro
 // CHECK-NOT: Name: .bss.a
 // CHECK:     Name: .bss

Modified: lld/trunk/test/ELF/shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/shared.s?rev=253970&r1=253969&r2=253970&view=diff
==============================================================================
--- lld/trunk/test/ELF/shared.s (original)
+++ lld/trunk/test/ELF/shared.s Tue Nov 24 04:04:22 2015
@@ -46,7 +46,7 @@
 // CHECK-NEXT:     SHF_ALLOC
 // CHECK-NEXT:   ]
 // CHECK-NEXT:   Address: [[DYNSYMADDR:.*]]
-// CHECK-NEXT:   Offset: 0x130
+// CHECK-NEXT:   Offset: 0x110
 // CHECK-NEXT:   Size:
 // CHECK-NEXT:   Link: [[DYNSTR:.*]]
 // CHECK-NEXT:   Info: 1




More information about the llvm-commits mailing list