summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-02-24 03:18:59 +0000
committerPetr Hosek <phosek@chromium.org>2017-02-24 03:18:59 +0000
commit9a2bba7251ab552b941d3964d6cb6f2b54fd14c0 (patch)
tree8113ca16f4d1dd56a9e6e79f07c23878e4ff0452
parent162540ec1da81657b8003ce1554a07b5d6f26c02 (diff)
downloadbcm5719-llvm-9a2bba7251ab552b941d3964d6cb6f2b54fd14c0.tar.gz
bcm5719-llvm-9a2bba7251ab552b941d3964d6cb6f2b54fd14c0.zip
Revert "[ELF] Make __ehdr_start point to ELF file headers"
This reverts commit r296079. llvm-svn: 296083
-rw-r--r--lld/ELF/Writer.cpp4
-rw-r--r--lld/test/ELF/ehdr_start.s22
2 files changed, 6 insertions, 20 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index b0c23df4dc6..835f4d0bcde 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -844,9 +844,9 @@ template <class ELFT> void Writer<ELFT>::addReservedSymbols() {
if (ScriptConfig->HasSections)
return;
- // __ehdr_start is the location of ELF file headers.
+ // __ehdr_start is the location of program headers.
ElfSym<ELFT>::EhdrStart =
- addOptionalSynthetic<ELFT>("__ehdr_start", Out<ELFT>::ElfHeader, 0);
+ addOptionalSynthetic<ELFT>("__ehdr_start", Out<ELFT>::ProgramHeaders, 0);
auto Define = [](StringRef S, DefinedSynthetic *&Sym1,
DefinedSynthetic *&Sym2) {
diff --git a/lld/test/ELF/ehdr_start.s b/lld/test/ELF/ehdr_start.s
index faca641755a..67d23cf7164 100644
--- a/lld/test/ELF/ehdr_start.s
+++ b/lld/test/ELF/ehdr_start.s
@@ -2,16 +2,8 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t
-# RUN: llvm-readobj -symbols %t | FileCheck %s
-# CHECK: Name: __ehdr_start (1)
-# CHECK-NEXT: Value: 0x200000
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Local (0x0)
-# CHECK-NEXT: Type: None (0x0)
-# CHECK-NEXT: Other [ (0x2)
-# CHECK-NEXT: STV_HIDDEN (0x2)
-# CHECK-NEXT: ]
-# CHECK-NEXT: Section: Undefined (0x0)
+# RUN: llvm-objdump -t %t | FileCheck %s
+# CHECK: 0000000000200040 .text 00000000 .hidden __ehdr_start
.text
.global _start, __ehdr_start
@@ -19,12 +11,6 @@ _start:
.quad __ehdr_start
# RUN: ld.lld -r %t.o -o %t.r
-# RUN: llvm-readobj -symbols %t.r | FileCheck %s --check-prefix=RELOCATABLE
+# RUN: llvm-objdump -t %t.r | FileCheck %s --check-prefix=RELOCATABLE
-# RELOCATABLE: Name: __ehdr_start (1)
-# RELOCATABLE-NEXT: Value: 0x0
-# RELOCATABLE-NEXT: Size: 0
-# RELOCATABLE-NEXT: Binding: Global (0x1)
-# RELOCATABLE-NEXT: Type: None (0x0)
-# RELOCATABLE-NEXT: Other: 0
-# RELOCATABLE-NEXT: Section: Undefined (0x0)
+# RELOCATABLE: 0000000000000000 *UND* 00000000 __ehdr_start
OpenPOWER on IntegriCloud