This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] ld-elf/ehdr_start: Pass --build-id to ld
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 17 Feb 2018 23:00:04 -0000
- Subject: [binutils-gdb] ld-elf/ehdr_start: Pass --build-id to ld
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d85502cffa5e41db6f2f2e1ba11d4285918dccdb
commit d85502cffa5e41db6f2f2e1ba11d4285918dccdb
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Feb 17 14:54:16 2018 -0800
ld-elf/ehdr_start: Pass --build-id to ld
ld-elf/ehdr_start fails with -z separate-code. Since there is no data
LOAD segment before code LOAD segment:
There are 2 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x200000 0x0000000000600000 0x0000000000600000 0x000010 0x000010 R E 0x200000
LOAD 0x400000 0x0000000000800000 0x0000000000800000 0x000008 0x000008 R 0x200000
Section to Segment mapping:
Segment Sections...
00 .text
01 .rodata
the program header isn't included in any LOAD segment. As the result,
reference to __ehdr_start is resolved to zero. Pass --build-id to ld
to add a data LOAD segment before code LOAD segment to put the program
header in the data LOAD segment.
PR ld/22845
* testsuite/ld-elf/ehdr_start.d: Pass --build-id to ld.
Diff:
---
ld/ChangeLog | 5 +++++
ld/testsuite/ld-elf/ehdr_start.d | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 811741f..2f022ec 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,6 +1,11 @@
2018-02-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22845
+ * testsuite/ld-elf/ehdr_start.d: Pass --build-id to ld.
+
+2018-02-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22845
* testsuite/ld-elf/binutils.exp (tls_opts): Add tests for
"-z noseparate-code" and "-z separate-code".
diff --git a/ld/testsuite/ld-elf/ehdr_start.d b/ld/testsuite/ld-elf/ehdr_start.d
index d538b66..14a85d0 100644
--- a/ld/testsuite/ld-elf/ehdr_start.d
+++ b/ld/testsuite/ld-elf/ehdr_start.d
@@ -1,5 +1,5 @@
#source: ehdr_start.s
-#ld: -e _start
+#ld: -e _start --build-id
#nm: -n
#target: *-*-linux* *-*-gnu* *-*-nacl*
#xfail: frv-*-*