[lld] r253971 - Reapply fixed r253967.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 24 02:15:50 PST 2015
Author: grimar
Date: Tue Nov 24 04:15:50 2015
New Revision: 253971
URL: http://llvm.org/viewvc/llvm-project?rev=253971&view=rev
Log:
Reapply fixed r253967.
Added:
lld/trunk/test/ELF/relro.s
- copied unchanged from r253969, 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Tue Nov 24 04:15:50 2015
@@ -67,6 +67,7 @@ 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Nov 24 04:15:50 2015
@@ -176,6 +176,7 @@ 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Nov 24 04:15:50 2015
@@ -47,6 +47,8 @@ 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);
@@ -81,6 +83,7 @@ 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;
@@ -353,6 +356,26 @@ static int getPPC64SectionRank(StringRef
.Default(1);
}
+template <class ELFT> static bool isRelroSection(OutputSectionBase<ELFT> *Sec) {
+ typename 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,
@@ -409,6 +432,12 @@ 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)
@@ -724,8 +753,10 @@ 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());
@@ -793,6 +824,18 @@ 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() {
@@ -819,6 +862,7 @@ 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.
@@ -852,6 +896,7 @@ template <class ELFT> void Writer<ELFT>:
VA = RoundUpToAlignment(VA, Sec->getAlign());
Sec->setVA(VA);
VA += Sec->getSize();
+ updateRelro(&Phdrs[PhdrIdx], &GnuRelroPhdr, Sec, VA);
}
}
@@ -881,6 +926,11 @@ 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) {
@@ -932,6 +982,8 @@ 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-merge.s (original)
+++ lld/trunk/test/ELF/eh-frame-merge.s Tue Nov 24 04:15:50 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: 880E0000 01000000 00000000 10000000 |
-// CHECK-NEXT: 0030: 30000000 760E0000 02000000 00000000 |
-// CHECK-NEXT: 0040: 10000000 44000000 610E0000 01000000 |
+// CHECK-NEXT: 0020: 500E0000 01000000 00000000 10000000 |
+// CHECK-NEXT: 0030: 30000000 3E0E0000 02000000 00000000 |
+// CHECK-NEXT: 0040: 10000000 44000000 290E0000 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/gnu-hash-table.s (original)
+++ lld/trunk/test/ELF/gnu-hash-table.s Tue Nov 24 04:15:50 2015
@@ -149,8 +149,8 @@
# PPC64-NEXT: Flags [
# PPC64-NEXT: SHF_ALLOC
# PPC64-NEXT: ]
-# PPC64-NEXT: Address: 0x1B8
-# PPC64-NEXT: Offset: 0x1B8
+# PPC64-NEXT: Address: 0x1F0
+# PPC64-NEXT: Offset: 0x1F0
# 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/got-aarch64.s (original)
+++ lld/trunk/test/ELF/got-aarch64.s Tue Nov 24 04:15:50 2015
@@ -10,7 +10,7 @@
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_WRITE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x2098
+// CHECK-NEXT: Address: 0x2090
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 8
// CHECK-NEXT: Link: 0
@@ -19,7 +19,7 @@
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT: 0x2098 R_AARCH64_GLOB_DAT dat 0x0
+// CHECK-NEXT: 0x2090 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, #152]
+// DISASM-NEXT: 1004: {{.*}} ldr x0, [x0, #144]
.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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-shared.s (original)
+++ lld/trunk/test/ELF/merge-shared.s Tue Nov 24 04:15:50 2015
@@ -17,10 +17,10 @@
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x158
+// CHECK-NEXT: Address: 0x190
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x15A
+// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x192
// 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-string.s (original)
+++ lld/trunk/test/ELF/merge-string.s Tue Nov 24 04:15:50 2015
@@ -26,8 +26,8 @@ zed:
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: SHF_STRINGS
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x158
-// CHECK-NEXT: Offset: 0x158
+// CHECK-NEXT: Address: 0x190
+// CHECK-NEXT: Offset: 0x190
// 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: 0x158
-// NOTAIL-NEXT: Offset: 0x158
+// NOTAIL-NEXT: Address: 0x190
+// NOTAIL-NEXT: Offset: 0x190
// 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: 0x15C
-// CHECK-NEXT: Offset: 0x15C
+// CHECK-NEXT: Address: 0x194
+// CHECK-NEXT: Offset: 0x194
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
@@ -75,11 +75,11 @@ zed:
// CHECK: Name: bar
-// CHECK-NEXT: Value: 0x159
+// CHECK-NEXT: Value: 0x191
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x158
+// CHECK-NEXT: Value: 0x190
// CHECK: Name: zed
-// CHECK-NEXT: Value: 0x15C
+// CHECK-NEXT: Value: 0x194
// 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-sym.s (original)
+++ lld/trunk/test/ELF/merge-sym.s Tue Nov 24 04:15:50 2015
@@ -15,7 +15,7 @@ foo:
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x158
+// CHECK-NEXT: Address: 0x190
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x15A
+// CHECK-NEXT: Value: 0x192
Modified: lld/trunk/test/ELF/mips-dynamic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-dynamic.s?rev=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-dynamic.s (original)
+++ lld/trunk/test/ELF/mips-dynamic.s Tue Nov 24 04:15:50 2015
@@ -20,24 +20,24 @@
# EXE-NEXT: Flags [
# EXE-NEXT: SHF_ALLOC
# EXE-NEXT: ]
-# EXE: Name: .rld_map
+# 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: Name: .got
+# EXE-NEXT: Size: 8
+# 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-NEXT: Size: 4
# 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-got-relocs.s (original)
+++ lld/trunk/test/ELF/mips-got-relocs.s Tue Nov 24 04:15:50 2015
@@ -45,21 +45,21 @@ v1:
.word 0
# EXE_SYM: Sections:
-# EXE_SYM: .got 0000000c 0000000000030004 DATA
+# EXE_SYM: .got 0000000c 0000000000030000 DATA
# EXE_SYM: SYMBOL TABLE:
-# EXE_SYM: 00037ff4 *ABS* 00000000 _gp
+# EXE_SYM: 00037ff0 *ABS* 00000000 _gp
# ^-- .got + GP offset (0x7ff0)
-# EXE_SYM: 00030000 g .data 00000004 v1
+# EXE_SYM: 00030010 g .data 00000004 v1
# EXE_GOT_BE: Contents of section .got:
-# EXE_GOT_BE: 30004 00000000 80000000 00030000
-# ^ ^ ^-- v1 (0x30000)
+# EXE_GOT_BE: 30000 00000000 80000000 00030010
+# ^ ^ ^-- v1 (0x30010)
# | +-- Module pointer (0x80000000)
# +-- Lazy resolver (0x0)
# EXE_GOT_EL: Contents of section .got:
-# EXE_GOT_EL: 30004 00000000 00000080 00000300
-# ^ ^ ^-- v1 (0x30000)
+# EXE_GOT_EL: 30000 00000000 00000080 10000300
+# ^ ^ ^-- v1 (0x30010)
# | +-- 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 0000000000020004 DATA
+# DSO_SYM: .got 0000000c 0000000000020000 DATA
# DSO_SYM: SYMBOL TABLE:
-# DSO_SYM: 00027ff4 *ABS* 00000000 _gp
+# DSO_SYM: 00027ff0 *ABS* 00000000 _gp
# ^-- .got + GP offset (0x7ff0)
-# DSO_SYM: 00020000 g .data 00000004 v1
+# DSO_SYM: 00020010 g .data 00000004 v1
# DSO_GOT_BE: Contents of section .got:
-# DSO_GOT_BE: 20004 00000000 80000000 00020000
-# ^ ^ ^-- v1 (0x20000)
+# DSO_GOT_BE: 20000 00000000 80000000 00020010
+# ^ ^ ^-- v1 (0x20010)
# | +-- Module pointer (0x80000000)
# +-- Lazy resolver (0x0)
# DSO_GOT_EL: Contents of section .got:
-# DSO_GOT_EL: 20004 00000000 00000080 00000200
-# ^ ^ ^-- v1 (0x20000)
+# DSO_GOT_EL: 20000 00000000 00000080 10000200
+# ^ ^ ^-- v1 (0x20010)
# | +-- 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=253971&r1=253970&r2=253971&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:15:50 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: 0x160 R_PPC64_ADDR64 external 0x0
+// CHECK-NEXT: 0x198 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/relative-dynamic-reloc.s (original)
+++ lld/trunk/test/ELF/relative-dynamic-reloc.s Tue Nov 24 04:15:50 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: 0x160 R_X86_64_64 external 0x0
+// CHECK-NEXT: 0x198 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/relocation.s (original)
+++ lld/trunk/test/ELF/relocation.s Tue Nov 24 04:15:50 2015
@@ -104,7 +104,7 @@ R_X86_64_64:
.quad R_X86_64_64
// CHECK: Contents of section .R_X86_64_64:
-// CHECK-NEXT: 10158 58010100 00000000
+// CHECK-NEXT: 10190 90010100 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: 10160 801f0000
+// CHECK-NEXT: 10198 481f0000
Modified: lld/trunk/test/ELF/section-name.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/section-name.s?rev=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/section-name.s (original)
+++ lld/trunk/test/ELF/section-name.s Tue Nov 24 04:15:50 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=253971&r1=253970&r2=253971&view=diff
==============================================================================
--- lld/trunk/test/ELF/shared.s (original)
+++ lld/trunk/test/ELF/shared.s Tue Nov 24 04:15:50 2015
@@ -46,7 +46,7 @@
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: ]
// CHECK-NEXT: Address: [[DYNSYMADDR:.*]]
-// CHECK-NEXT: Offset: 0x110
+// CHECK-NEXT: Offset: 0x130
// CHECK-NEXT: Size:
// CHECK-NEXT: Link: [[DYNSTR:.*]]
// CHECK-NEXT: Info: 1
More information about the llvm-commits
mailing list