[lld] r254003 - Revert "ELF: Make .note.GNU-stack more compatible with traditional linkers."
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 24 10:48:17 PST 2015
Author: ruiu
Date: Tue Nov 24 12:48:16 2015
New Revision: 254003
URL: http://llvm.org/viewvc/llvm-project?rev=254003&view=rev
Log:
Revert "ELF: Make .note.GNU-stack more compatible with traditional linkers."
This reverts commit r253797 because it was based on a misunderstanding
that lld wouldn't work on NetBSD without this change.
Modified:
lld/trunk/ELF/Config.h
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/InputFiles.cpp
lld/trunk/ELF/Writer.cpp
lld/trunk/test/ELF/basic-aarch64.s
lld/trunk/test/ELF/basic-mips.s
lld/trunk/test/ELF/basic.s
lld/trunk/test/ELF/basic32.s
lld/trunk/test/ELF/basic64be.s
lld/trunk/test/ELF/eh-frame-merge.s
lld/trunk/test/ELF/gnu-hash-table.s
lld/trunk/test/ELF/gnustack.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/merge.s
lld/trunk/test/ELF/program-header-layout.s
lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s
lld/trunk/test/ELF/relative-dynamic-reloc.s
lld/trunk/test/ELF/relocation-local.s
lld/trunk/test/ELF/relocation.s
lld/trunk/test/ELF/shared.s
lld/trunk/test/ELF/string-table.s
lld/trunk/test/ELF/symbols.s
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Tue Nov 24 12:48:16 2015
@@ -63,7 +63,7 @@ struct Configuration {
bool StripAll;
bool SysvHash = true;
bool Verbose;
- bool ZExecStack = false;
+ bool ZExecStack;
bool ZNodelete;
bool ZNow;
bool ZOrigin;
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Nov 24 12:48:16 2015
@@ -183,6 +183,7 @@ void LinkerDriver::createFiles(opt::Inpu
Config->SoName = getString(Args, OPT_soname);
Config->Sysroot = getString(Args, OPT_sysroot);
+ Config->ZExecStack = hasZOption(Args, "execstack");
Config->ZNodelete = hasZOption(Args, "nodelete");
Config->ZNow = hasZOption(Args, "now");
Config->ZOrigin = hasZOption(Args, "origin");
@@ -287,14 +288,6 @@ template <class ELFT> void LinkerDriver:
for (StringRef S : Config->Undefined)
Symtab.addUndefinedOpt(S);
- // "-z execstack" value is inferred from input object files (it's false
- // if all input files have .note.GNU-stack section). Explicit options
- // override the inferred default value.
- if (hasZOption(Args, "execstack"))
- Config->ZExecStack = true;
- if (hasZOption(Args, "noexecstack"))
- Config->ZExecStack = false;
-
if (Config->OutputFile.empty())
Config->OutputFile = "a.out";
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Nov 24 12:48:16 2015
@@ -174,7 +174,6 @@ void elf2::ObjectFile<ELFT>::initializeS
uint64_t Size = this->ELFObj.getNumSections();
Sections.resize(Size);
unsigned I = -1;
- bool HasGnuStack = false;
const ELFFile<ELFT> &Obj = this->ELFObj;
for (const Elf_Shdr &Sec : Obj.sections()) {
++I;
@@ -229,21 +228,17 @@ void elf2::ObjectFile<ELFT>::initializeS
ErrorOr<StringRef> NameOrErr = this->ELFObj.getSectionName(&Sec);
error(NameOrErr);
StringRef Name = *NameOrErr;
- if (Name == ".note.GNU-stack") {
+ if (Name == ".note.GNU-stack")
Sections[I] = &InputSection<ELFT>::Discarded;
- HasGnuStack = true;
- } else if (Name == ".eh_frame") {
+ else if (Name == ".eh_frame")
Sections[I] = new (this->Alloc) EHInputSection<ELFT>(this, &Sec);
- } else if (shouldMerge<ELFT>(Sec)) {
+ else if (shouldMerge<ELFT>(Sec))
Sections[I] = new (this->Alloc) MergeInputSection<ELFT>(this, &Sec);
- } else {
+ else
Sections[I] = new (this->Alloc) InputSection<ELFT>(this, &Sec);
- }
break;
}
}
- if (!HasGnuStack)
- Config->ZExecStack = true;
}
template <class ELFT> void elf2::ObjectFile<ELFT>::initializeSymbols() {
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Nov 24 12:48:16 2015
@@ -933,11 +933,12 @@ template <class ELFT> void Writer<ELFT>:
// PT_GNU_STACK is a special section to tell the loader to make the
// pages for the stack non-executable.
- if (!Config->ZExecStack) {
- Elf_Phdr *PH = &Phdrs[++PhdrIdx];
- PH->p_type = PT_GNU_STACK;
+ Elf_Phdr *PH = &Phdrs[++PhdrIdx];
+ PH->p_type = PT_GNU_STACK;
+ if (Config->ZExecStack)
+ PH->p_flags = PF_R | PF_W | PF_X;
+ else
PH->p_flags = PF_R | PF_W;
- }
// Fix up PT_INTERP as we now know the address of .interp section.
if (Interp) {
@@ -961,13 +962,11 @@ template <class ELFT> void Writer<ELFT>:
// Returns the number of PHDR entries.
template <class ELFT> int Writer<ELFT>::getPhdrsNum() const {
bool Tls = false;
- int I = 2; // 2 for PT_PHDR and first PT_LOAD
+ int I = 3; // 3 for PT_PHDR, first PT_LOAD and PT_GNU_STACK
if (needsInterpSection())
++I;
if (isOutputDynamic())
++I;
- if (!Config->ZExecStack)
- ++I;
uintX_t Last = PF_R;
for (OutputSectionBase<ELFT> *Sec : OutputSections) {
if (!needsPhdr<ELFT>(Sec))
Modified: lld/trunk/test/ELF/basic-aarch64.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/basic-aarch64.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/basic-aarch64.s (original)
+++ lld/trunk/test/ELF/basic-aarch64.s Tue Nov 24 12:48:16 2015
@@ -31,7 +31,7 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: HeaderSize: 64
# CHECK-NEXT: ProgramHeaderEntrySize: 56
-# CHECK-NEXT: ProgramHeaderCount: 3
+# CHECK-NEXT: ProgramHeaderCount: 4
# CHECK-NEXT: SectionHeaderEntrySize: 64
# CHECK-NEXT: SectionHeaderCount: 5
# CHECK-NEXT: StringTableSectionIndex: 3
@@ -145,8 +145,8 @@ _start:
# CHECK-NEXT: Offset: 0x40
# CHECK-NEXT: VirtualAddress: 0x10040
# CHECK-NEXT: PhysicalAddress: 0x10040
-# CHECK-NEXT: FileSize: 168
-# CHECK-NEXT: MemSize: 168
+# CHECK-NEXT: FileSize: 224
+# CHECK-NEXT: MemSize: 224
# CHECK-NEXT: Flags [ (0x4)
# CHECK-NEXT: PF_R (0x4)
# CHECK-NEXT: ]
@@ -157,8 +157,8 @@ _start:
# CHECK-NEXT: Offset: 0x0
# CHECK-NEXT: VirtualAddress: 0x10000
# CHECK-NEXT: PhysicalAddress: 0x10000
-# CHECK-NEXT: FileSize: 232
-# CHECK-NEXT: MemSize: 232
+# CHECK-NEXT: FileSize: 288
+# CHECK-NEXT: MemSize: 288
# CHECK-NEXT: Flags [
# CHECK-NEXT: PF_R
# CHECK-NEXT: ]
@@ -177,4 +177,17 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: Alignment: 4096
# CHECK-NEXT: }
+# CHECK-NEXT: ProgramHeader {
+# CHECK-NEXT: Type: PT_GNU_STACK
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: PhysicalAddress: 0x0
+# CHECK-NEXT: FileSize: 0
+# CHECK-NEXT: MemSize: 0
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: PF_R
+# CHECK-NEXT: PF_W
+# CHECK-NEXT: ]
+# CHECK-NEXT: Alignment: 0
+# CHECK-NEXT: }
# CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/basic-mips.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/basic-mips.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/basic-mips.s (original)
+++ lld/trunk/test/ELF/basic-mips.s Tue Nov 24 12:48:16 2015
@@ -32,7 +32,7 @@ __start:
# CHECK-NEXT: ]
# CHECK-NEXT: HeaderSize: 52
# CHECK-NEXT: ProgramHeaderEntrySize: 32
-# CHECK-NEXT: ProgramHeaderCount: 4
+# CHECK-NEXT: ProgramHeaderCount: 5
# CHECK-NEXT: SectionHeaderEntrySize: 40
# CHECK-NEXT: SectionHeaderCount: 9
# CHECK-NEXT: StringTableSectionIndex: 7
@@ -59,8 +59,8 @@ __start:
# CHECK-NEXT: Flags [ (0x2)
# CHECK-NEXT: SHF_ALLOC (0x2)
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x100B4
-# CHECK-NEXT: Offset: 0xB4
+# CHECK-NEXT: Address: 0x100D4
+# CHECK-NEXT: Offset: 0xD4
# CHECK-NEXT: Size: 24
# CHECK-NEXT: Link: 0
# CHECK-NEXT: Info: 0
@@ -74,8 +74,8 @@ __start:
# CHECK-NEXT: Flags [ (0x2)
# CHECK-NEXT: SHF_ALLOC (0x2)
# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x100D0
-# CHECK-NEXT: Offset: 0xD0
+# CHECK-NEXT: Address: 0x100F0
+# CHECK-NEXT: Offset: 0xF0
# CHECK-NEXT: Size: 24
# CHECK-NEXT: Link: 0
# CHECK-NEXT: Info: 0
@@ -208,8 +208,8 @@ __start:
# CHECK-NEXT: Offset: 0x34
# CHECK-NEXT: VirtualAddress: 0x10034
# CHECK-NEXT: PhysicalAddress: 0x10034
-# CHECK-NEXT: FileSize: 128
-# CHECK-NEXT: MemSize: 128
+# CHECK-NEXT: FileSize: 160
+# CHECK-NEXT: MemSize: 160
# CHECK-NEXT: Flags [ (0x4)
# CHECK-NEXT: PF_R (0x4)
# CHECK-NEXT: ]
@@ -220,8 +220,8 @@ __start:
# CHECK-NEXT: Offset: 0x0
# CHECK-NEXT: VirtualAddress: 0x10000
# CHECK-NEXT: PhysicalAddress: 0x10000
-# CHECK-NEXT: FileSize: 232
-# CHECK-NEXT: MemSize: 232
+# CHECK-NEXT: FileSize: 264
+# CHECK-NEXT: MemSize: 264
# CHECK-NEXT: Flags [ (0x4)
# CHECK-NEXT: PF_R (0x4)
# CHECK-NEXT: ]
@@ -253,4 +253,17 @@ __start:
# CHECK-NEXT: ]
# CHECK-NEXT: Alignment: 65536
# CHECK-NEXT: }
-# CHECK-NEXT: ]
+# CHECK-NEXT: ProgramHeader {
+# CHECK-NEXT: Type: PT_GNU_STACK
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: PhysicalAddress: 0x0
+# CHECK-NEXT: FileSize: 0
+# CHECK-NEXT: MemSize: 0
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: PF_R
+# CHECK-NEXT: PF_W
+# CHECK-NEXT: ]
+# CHECK-NEXT: Alignment: 0
+# CHECK-NEXT: }
+# CHECK-NEXT:]
Modified: lld/trunk/test/ELF/basic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/basic.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/basic.s (original)
+++ lld/trunk/test/ELF/basic.s Tue Nov 24 12:48:16 2015
@@ -32,7 +32,7 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: HeaderSize: 64
# CHECK-NEXT: ProgramHeaderEntrySize: 56
-# CHECK-NEXT: ProgramHeaderCount: 3
+# CHECK-NEXT: ProgramHeaderCount: 4
# CHECK-NEXT: SectionHeaderEntrySize: 64
# CHECK-NEXT: SectionHeaderCount: 5
# CHECK-NEXT: StringTableSectionIndex: 3
@@ -137,8 +137,8 @@ _start:
# CHECK-NEXT: Offset: 0x40
# CHECK-NEXT: VirtualAddress: 0x10040
# CHECK-NEXT: PhysicalAddress: 0x10040
-# CHECK-NEXT: FileSize: 168
-# CHECK-NEXT: MemSize: 168
+# CHECK-NEXT: FileSize: 224
+# CHECK-NEXT: MemSize: 224
# CHECK-NEXT: Flags [ (0x4)
# CHECK-NEXT: PF_R (0x4)
# CHECK-NEXT: ]
@@ -149,8 +149,8 @@ _start:
# CHECK-NEXT: Offset: 0x0
# CHECK-NEXT: VirtualAddress: 0x10000
# CHECK-NEXT: PhysicalAddress: 0x10000
-# CHECK-NEXT: FileSize: 232
-# CHECK-NEXT: MemSize: 232
+# CHECK-NEXT: FileSize: 288
+# CHECK-NEXT: MemSize: 288
# CHECK-NEXT: Flags [
# CHECK-NEXT: PF_R
# CHECK-NEXT: ]
@@ -169,6 +169,19 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: Alignment: 4096
# CHECK-NEXT: }
+# CHECK-NEXT: ProgramHeader {
+# CHECK-NEXT: Type: PT_GNU_STACK
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: PhysicalAddress: 0x0
+# CHECK-NEXT: FileSize: 0
+# CHECK-NEXT: MemSize: 0
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: PF_R
+# CHECK-NEXT: PF_W
+# CHECK-NEXT: ]
+# CHECK-NEXT: Alignment: 0
+# CHECK-NEXT: }
# CHECK-NEXT: ]
# Test for the response file
Modified: lld/trunk/test/ELF/basic32.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/basic32.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/basic32.s (original)
+++ lld/trunk/test/ELF/basic32.s Tue Nov 24 12:48:16 2015
@@ -30,7 +30,7 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: HeaderSize: 52
# CHECK-NEXT: ProgramHeaderEntrySize: 32
-# CHECK-NEXT: ProgramHeaderCount: 3
+# CHECK-NEXT: ProgramHeaderCount: 4
# CHECK-NEXT: SectionHeaderEntrySize: 40
# CHECK-NEXT: SectionHeaderCount: 5
# CHECK-NEXT: StringTableSectionIndex: 3
@@ -115,8 +115,8 @@ _start:
# CHECK-NEXT: Offset: 0x34
# CHECK-NEXT: VirtualAddress: 0x10034
# CHECK-NEXT: PhysicalAddress: 0x10034
-# CHECK-NEXT: FileSize: 96
-# CHECK-NEXT: MemSize: 96
+# CHECK-NEXT: FileSize: 128
+# CHECK-NEXT: MemSize: 128
# CHECK-NEXT: Flags [ (0x4)
# CHECK-NEXT: PF_R (0x4)
# CHECK-NEXT: ]
@@ -127,8 +127,8 @@ _start:
# CHECK-NEXT: Offset: 0x0
# CHECK-NEXT: VirtualAddress: 0x10000
# CHECK-NEXT: PhysicalAddress: 0x10000
-# CHECK-NEXT: FileSize: 148
-# CHECK-NEXT: MemSize: 148
+# CHECK-NEXT: FileSize: 180
+# CHECK-NEXT: MemSize: 180
# CHECK-NEXT: Flags [
# CHECK-NEXT: PF_R
# CHECK-NEXT: ]
@@ -147,4 +147,17 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: Alignment: 4096
# CHECK-NEXT: }
+# CHECK-NEXT: ProgramHeader {
+# CHECK-NEXT: Type: PT_GNU_STACK
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: PhysicalAddress: 0x0
+# CHECK-NEXT: FileSize: 0
+# CHECK-NEXT: MemSize: 0
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: PF_R
+# CHECK-NEXT: PF_W
+# CHECK-NEXT: ]
+# CHECK-NEXT: Alignment: 0
+# CHECK-NEXT: }
# CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/basic64be.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/basic64be.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/basic64be.s (original)
+++ lld/trunk/test/ELF/basic64be.s Tue Nov 24 12:48:16 2015
@@ -43,7 +43,7 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: HeaderSize: 64
# CHECK-NEXT: ProgramHeaderEntrySize: 56
-# CHECK-NEXT: ProgramHeaderCount: 4
+# CHECK-NEXT: ProgramHeaderCount: 5
# CHECK-NEXT: SectionHeaderEntrySize: 64
# CHECK-NEXT: SectionHeaderCount: 8
# CHECK-NEXT: StringTableSectionIndex: 6
@@ -199,8 +199,8 @@ _start:
# CHECK-NEXT: Offset: 0x40
# CHECK-NEXT: VirtualAddress: 0x10000040
# CHECK-NEXT: PhysicalAddress: 0x10000040
-# CHECK-NEXT: FileSize: 224
-# CHECK-NEXT: MemSize: 224
+# CHECK-NEXT: FileSize: 280
+# CHECK-NEXT: MemSize: 280
# CHECK-NEXT: Flags [ (0x4)
# CHECK-NEXT: PF_R (0x4)
# CHECK-NEXT: ]
@@ -211,8 +211,8 @@ _start:
# CHECK-NEXT: Offset: 0x0
# CHECK-NEXT: VirtualAddress: 0x10000000
# CHECK-NEXT: PhysicalAddress: 0x10000000
-# CHECK-NEXT: FileSize: 288
-# CHECK-NEXT: MemSize: 288
+# CHECK-NEXT: FileSize: 344
+# CHECK-NEXT: MemSize: 344
# CHECK-NEXT: Flags [
# CHECK-NEXT: PF_R
# CHECK-NEXT: ]
@@ -220,7 +220,7 @@ _start:
# CHECK-NEXT: }
# CHECK-NEXT: ProgramHeader {
# CHECK-NEXT: Type: PT_LOAD (0x1)
-# CHECK-NEXT: Offset: 0x1000
+# CHECK-NEXT: Offset: 0x10000
# CHECK-NEXT: VirtualAddress: 0x10010000
# CHECK-NEXT: PhysicalAddress: 0x10010000
# CHECK-NEXT: FileSize: 12
@@ -233,7 +233,7 @@ _start:
# CHECK-NEXT: }
# CHECK-NEXT: ProgramHeader {
# CHECK-NEXT: Type: PT_LOAD (0x1)
-# CHECK-NEXT: Offset: 0x2000
+# CHECK-NEXT: Offset: 0x20000
# CHECK-NEXT: VirtualAddress: 0x10020000
# CHECK-NEXT: PhysicalAddress: 0x10020000
# CHECK-NEXT: FileSize: 88
@@ -244,4 +244,17 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: Alignment: 65536
# CHECK-NEXT: }
-# CHECK-NEXT:]
+# CHECK-NEXT: ProgramHeader {
+# CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551)
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: PhysicalAddress: 0x0
+# CHECK-NEXT: FileSize: 0
+# CHECK-NEXT: MemSize: 0
+# CHECK-NEXT: Flags [ (0x6)
+# CHECK-NEXT: PF_R (0x4)
+# CHECK-NEXT: PF_W (0x2)
+# CHECK-NEXT: ]
+# CHECK-NEXT: Alignment: 0
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
\ No newline at end of file
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=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-merge.s (original)
+++ lld/trunk/test/ELF/eh-frame-merge.s Tue Nov 24 12:48:16 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: 180E0000 01000000 00000000 10000000 |
+// CHECK-NEXT: 0030: 30000000 060E0000 02000000 00000000 |
+// CHECK-NEXT: 0040: 10000000 44000000 F10D0000 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=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/gnu-hash-table.s (original)
+++ lld/trunk/test/ELF/gnu-hash-table.s Tue Nov 24 12:48:16 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: 0x228
+# PPC64-NEXT: Offset: 0x228
# PPC64-NEXT: Size: 36
# PPC64-NEXT: Link: 1
# PPC64-NEXT: Info: 0
Modified: lld/trunk/test/ELF/gnustack.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gnustack.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/gnustack.s (original)
+++ lld/trunk/test/ELF/gnustack.s Tue Nov 24 12:48:16 2015
@@ -1,14 +1,9 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t2
# RUN: ld.lld %t1 -z execstack -o %t
# RUN: llvm-readobj --program-headers -s %t | FileCheck --check-prefix=CHECK_RWX %s
# RUN: ld.lld %t1 -o %t
# RUN: llvm-readobj --program-headers -s %t | FileCheck --check-prefix=CHECK_RW %s
-# RUN: ld.lld %t1 %t2 -o %t
-# RUN: llvm-readobj --program-headers -s %t | FileCheck --check-prefix=CHECK_RWX %s
-# RUN: ld.lld %t1 %t2 -z noexecstack -o %t
-# RUN: llvm-readobj --program-headers -s %t | FileCheck --check-prefix=CHECK_RW %s
# CHECK_RW: Sections [
# CHECK_RW-NOT: Name: .note.GNU-stack
@@ -28,8 +23,24 @@
# CHECK_RW-NEXT: }
# CHECK_RW-NEXT: ]
-# CHECK_RWX-NOT: Type: PT_GNU_STACK
+# CHECK_RWX: Sections [
+# CHECK_RWX-NOT: Name: .note.GNU-stack
+# CHECK_RWX: ProgramHeaders [
+# CHECK_RWX: ProgramHeader {
+# CHECK_RWX: Type: PT_GNU_STACK
+# CHECK_RWX-NEXT: Offset: 0x0
+# CHECK_RWX-NEXT: VirtualAddress: 0x0
+# CHECK_RWX-NEXT: PhysicalAddress: 0x0
+# CHECK_RWX-NEXT: FileSize: 0
+# CHECK_RWX-NEXT: MemSize: 0
+# CHECK_RWX-NEXT: Flags [
+# CHECK_RWX-NEXT: PF_R
+# CHECK_RWX-NEXT: PF_W
+# CHECK_RWX-NEXT: PF_X
+# CHECK_RWX-NEXT: ]
+# CHECK_RWX-NEXT: Alignment: 0
+# CHECK_RWX-NEXT: }
+# CHECK_RWX-NEXT: ]
.globl _start
_start:
-.section .note.GNU-stack,""
Modified: lld/trunk/test/ELF/merge-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-shared.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-shared.s (original)
+++ lld/trunk/test/ELF/merge-shared.s Tue Nov 24 12:48:16 2015
@@ -17,10 +17,10 @@
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x190
+// CHECK-NEXT: Address: 0x1C8
// CHECK: Relocations [
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x192
+// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x1CA
// 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=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-string.s (original)
+++ lld/trunk/test/ELF/merge-string.s Tue Nov 24 12:48:16 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: 0x1C8
+// CHECK-NEXT: Offset: 0x1C8
// 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: 0x1C8
+// NOTAIL-NEXT: Offset: 0x1C8
// 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: 0x1CC
+// CHECK-NEXT: Offset: 0x1CC
// 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: 0x1C9
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x190
+// CHECK-NEXT: Value: 0x1C8
// CHECK: Name: zed
-// CHECK-NEXT: Value: 0x194
+// CHECK-NEXT: Value: 0x1CC
// 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=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge-sym.s (original)
+++ lld/trunk/test/ELF/merge-sym.s Tue Nov 24 12:48:16 2015
@@ -15,7 +15,7 @@ foo:
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x190
+// CHECK-NEXT: Address: 0x1C8
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x192
+// CHECK-NEXT: Value: 0x1CA
Modified: lld/trunk/test/ELF/merge.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/merge.s (original)
+++ lld/trunk/test/ELF/merge.s Tue Nov 24 12:48:16 2015
@@ -23,8 +23,8 @@ zed:
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: SHF_MERGE
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x100E8
-// CHECK-NEXT: Offset: 0xE8
+// CHECK-NEXT: Address: 0x10120
+// CHECK-NEXT: Offset: 0x120
// CHECK-NEXT: Size: 8
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
@@ -35,13 +35,13 @@ zed:
// CHECK-NEXT: )
-// Address of the constant 0x10 = 0x100E8 = 65768
-// Address of the constant 0x42 = 0x100EC = 65772
+// Address of the constant 0x10 = 0x10120 = 65824
+// Address of the constant 0x42 = 0x10124 = 65828
// CHECK: Symbols [
// CHECK: Name: bar
-// CHECK-NEXT: Value: 0x100EC
+// CHECK-NEXT: Value: 0x10124
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Loca
// CHECK-NEXT: Type: None
@@ -49,7 +49,7 @@ zed:
// CHECK-NEXT: Section: .mysec
// CHECK: Name: zed
-// CHECK-NEXT: Value: 0x100EC
+// CHECK-NEXT: Value: 0x10124
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -57,7 +57,7 @@ zed:
// CHECK-NEXT: Section: .mysec
// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x100EC
+// CHECK-NEXT: Value: 0x10124
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -73,37 +73,37 @@ _start:
// DISASM-NEXT: _start:
movl .mysec, %eax
-// addr(0x10) = 65768
-// DISASM-NEXT: movl 65768, %eax
+// addr(0x10) = 65824
+// DISASM-NEXT: movl 65824, %eax
movl .mysec+7, %eax
-// addr(0x42) + 3 = 65772 + 3 = 65775
-// DISASM-NEXT: movl 65775, %eax
+// addr(0x42) + 3 = 65828 + 3 = 65831
+// DISASM-NEXT: movl 65831, %eax
movl .mysec+8, %eax
-// addr(0x42) = 65772
-// DISASM-NEXT: movl 65772, %eax
+// addr(0x42) = 65828
+// DISASM-NEXT: movl 65828, %eax
movl bar+7, %eax
-// addr(0x42) + 7 = 65772 + 7 = 65779
-// DISASM-NEXT: movl 65779, %eax
+// addr(0x42) + 7 = 65828 + 7 = 65835
+// DISASM-NEXT: movl 65835, %eax
movl bar+8, %eax
-// addr(0x42) + 8 = 65772 + 8 = 65780
-// DISASM-NEXT: movl 65780, %eax
+// addr(0x42) + 8 = 65828 + 8 = 65836
+// DISASM-NEXT: movl 65836, %eax
movl foo, %eax
-// addr(0x42) = 65772
-// DISASM-NEXT: movl 65772, %eax
+// addr(0x42) = 65828
+// DISASM-NEXT: movl 65828, %eax
movl foo+7, %eax
-// addr(0x42) + 7 = = 65772 + 7 = 65779
-// DISASM-NEXT: movl 65779, %eax
+// addr(0x42) + 7 = = 65828 + 7 = 65835
+// DISASM-NEXT: movl 65835, %eax
movl foo+8, %eax
-// addr(0x42) + 8 = = 65772 + 8 = 65780
-// DISASM-NEXT: movl 65780, %eax
+// addr(0x42) + 8 = = 65828 + 8 = 65836
+// DISASM-NEXT: movl 65836, %eax
// From the other file: movl .mysec, %eax
-// addr(0x42) = 65772
-// DISASM-NEXT: movl 65772, %eax
+// addr(0x42) = 65828
+// DISASM-NEXT: movl 65828, %eax
Modified: lld/trunk/test/ELF/program-header-layout.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/program-header-layout.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/program-header-layout.s (original)
+++ lld/trunk/test/ELF/program-header-layout.s Tue Nov 24 12:48:16 2015
@@ -23,7 +23,7 @@ _start:
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
-# CHECK-NEXT: Offset: 0x120
+# CHECK-NEXT: Offset: 0x158
# CHECK-NEXT: Size:
# CHECK-NEXT: Link:
# CHECK-NEXT: Info:
@@ -37,8 +37,8 @@ _start:
# CHECK-NEXT: Offset: 0x40
# CHECK-NEXT: VirtualAddress: 0x10040
# CHECK-NEXT: PhysicalAddress: 0x10040
-# CHECK-NEXT: FileSize: 224
-# CHECK-NEXT: MemSize: 224
+# CHECK-NEXT: FileSize: 280
+# CHECK-NEXT: MemSize: 280
# CHECK-NEXT: Flags [ (0x4)
# CHECK-NEXT: PF_R (0x4)
# CHECK-NEXT: ]
@@ -49,8 +49,8 @@ _start:
# CHECK-NEXT: Offset: 0x0
# CHECK-NEXT: VirtualAddress:
# CHECK-NEXT: PhysicalAddress:
-# CHECK-NEXT: FileSize: 296
-# CHECK-NEXT: MemSize: 296
+# CHECK-NEXT: FileSize: 352
+# CHECK-NEXT: MemSize: 352
# CHECK-NEXT: Flags [
# CHECK-NEXT: PF_R
# CHECK-NEXT: ]
@@ -82,4 +82,17 @@ _start:
# CHECK-NEXT: ]
# CHECK-NEXT: Alignment:
# CHECK-NEXT: }
+# CHECK-NEXT: ProgramHeader {
+# CHECK-NEXT: Type: PT_GNU_STACK
+# CHECK-NEXT: Offset: 0x0
+# CHECK-NEXT: VirtualAddress: 0x0
+# CHECK-NEXT: PhysicalAddress: 0x0
+# CHECK-NEXT: FileSize: 0
+# CHECK-NEXT: MemSize: 0
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: PF_R
+# CHECK-NEXT: PF_W
+# CHECK-NEXT: ]
+# CHECK-NEXT: Alignment: 0
+# CHECK-NEXT: }
# CHECK-NEXT: ]
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=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s (original)
+++ lld/trunk/test/ELF/relative-dynamic-reloc-ppc64.s Tue Nov 24 12:48:16 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: 0x1D0 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=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/relative-dynamic-reloc.s (original)
+++ lld/trunk/test/ELF/relative-dynamic-reloc.s Tue Nov 24 12:48:16 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: 0x1D0 R_X86_64_64 external 0x0
// CHECK-NEXT: }
// CHECK-NEXT: ]
Modified: lld/trunk/test/ELF/relocation-local.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocation-local.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/relocation-local.s (original)
+++ lld/trunk/test/ELF/relocation-local.s Tue Nov 24 12:48:16 2015
@@ -35,4 +35,4 @@ R_X86_64_64:
.quad R_X86_64_64
// CHECK: Contents of section .R_X86_64_64:
-// CHECK-NEXT: 100e8 e8000100 00000000
+// CHECK-NEXT: 10120 20010100 00000000
Modified: lld/trunk/test/ELF/relocation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/relocation.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/relocation.s (original)
+++ lld/trunk/test/ELF/relocation.s Tue Nov 24 12:48:16 2015
@@ -104,14 +104,14 @@ R_X86_64_64:
.quad R_X86_64_64
// CHECK: Contents of section .R_X86_64_64:
-// CHECK-NEXT: 10190 90010100 00000000
+// CHECK-NEXT: 101c8 c8010100 00000000
.section .R_X86_64_GOTPCREL,"a", at progbits
.global R_X86_64_GOTPCREL
R_X86_64_GOTPCREL:
.long zed at gotpcrel
-// 0x120A8 - 0x10160 = 8008
-// 8008 = 0x481f0000 in little endian
+// 0x120E8 - 0x101D8 = 7952
+// 7952 = 0x101f0000 in little endian
// CHECK: Contents of section .R_X86_64_GOTPCREL
-// CHECK-NEXT: 10198 481f0000
+// CHECK-NEXT: 101d0 101f0000
Modified: lld/trunk/test/ELF/shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/shared.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/shared.s (original)
+++ lld/trunk/test/ELF/shared.s Tue Nov 24 12:48:16 2015
@@ -46,7 +46,7 @@
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: ]
// CHECK-NEXT: Address: [[DYNSYMADDR:.*]]
-// CHECK-NEXT: Offset: 0x130
+// CHECK-NEXT: Offset: 0x150
// CHECK-NEXT: Size:
// CHECK-NEXT: Link: [[DYNSTR:.*]]
// CHECK-NEXT: Info: 1
Modified: lld/trunk/test/ELF/string-table.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/string-table.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/string-table.s (original)
+++ lld/trunk/test/ELF/string-table.s Tue Nov 24 12:48:16 2015
@@ -19,7 +19,7 @@ _start:
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x100E8
+// CHECK-NEXT: Address: 0x10120
// CHECK: Name: foobar
// CHECK-NEXT: Type: SHT_PROGBITS
Modified: lld/trunk/test/ELF/symbols.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/symbols.s?rev=254003&r1=254002&r2=254003&view=diff
==============================================================================
--- lld/trunk/test/ELF/symbols.s (original)
+++ lld/trunk/test/ELF/symbols.s Tue Nov 24 12:48:16 2015
@@ -50,7 +50,7 @@ internal:
// CHECK-NEXT: Flags [
// CHECK-NEXT: SHF_ALLOC
// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x10120
+// CHECK-NEXT: Address: 0x10158
// CHECK: Name: .text
// CHECK-NEXT: Type: SHT_PROGBITS
@@ -82,7 +82,7 @@ internal:
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: hidden
-// CHECK-NEXT: Value: 0x10128
+// CHECK-NEXT: Value: 0x10160
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -91,7 +91,7 @@ internal:
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: internal
-// CHECK-NEXT: Value: 0x10128
+// CHECK-NEXT: Value: 0x10160
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -145,7 +145,7 @@ internal:
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: protected
-// CHECK-NEXT: Value: 0x10128
+// CHECK-NEXT: Value: 0x10160
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: None
@@ -154,7 +154,7 @@ internal:
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: zed
-// CHECK-NEXT: Value: 0x10120
+// CHECK-NEXT: Value: 0x10158
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: None
@@ -163,7 +163,7 @@ internal:
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: zed2
-// CHECK-NEXT: Value: 0x10124
+// CHECK-NEXT: Value: 0x1015C
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: None
@@ -172,7 +172,7 @@ internal:
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: zed3
-// CHECK-NEXT: Value: 0x10128
+// CHECK-NEXT: Value: 0x10160
// CHECK-NEXT: Size: 4
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: None
More information about the llvm-commits
mailing list