[lld] r296083 - Revert "[ELF] Make __ehdr_start point to ELF file headers"
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 23 19:18:59 PST 2017
Author: phosek
Date: Thu Feb 23 21:18:59 2017
New Revision: 296083
URL: http://llvm.org/viewvc/llvm-project?rev=296083&view=rev
Log:
Revert "[ELF] Make __ehdr_start point to ELF file headers"
This reverts commit r296079.
Modified:
lld/trunk/ELF/Writer.cpp
lld/trunk/test/ELF/ehdr_start.s
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=296083&r1=296082&r2=296083&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Feb 23 21:18:59 2017
@@ -844,9 +844,9 @@ template <class ELFT> void Writer<ELFT>:
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) {
Modified: lld/trunk/test/ELF/ehdr_start.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/ehdr_start.s?rev=296083&r1=296082&r2=296083&view=diff
==============================================================================
--- lld/trunk/test/ELF/ehdr_start.s (original)
+++ lld/trunk/test/ELF/ehdr_start.s Thu Feb 23 21:18:59 2017
@@ -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
More information about the llvm-commits
mailing list