This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] PR ld/21529: Use a linker script to limit output with the test case
- From: Maciej W.Rozycki <macro at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 14 Jul 2017 10:54:16 -0000
- Subject: [binutils-gdb] PR ld/21529: Use a linker script to limit output with the test case
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=211b0bed95b3f6b177a541ec52302b8febd6b49c
commit 211b0bed95b3f6b177a541ec52302b8febd6b49c
Author: Maciej W. Rozycki <macro@imgtec.com>
Date: Fri Jul 14 11:53:08 2017 +0100
PR ld/21529: Use a linker script to limit output with the test case
Complement commit d9409498813c ("Add a testcase for PR ld/21529") and
use a linker script to prevent an inter-segment gap arranged by the
default linker script associated with some targets such as `rx-elf':
$ ld -e main -o tmpdir/dump-elf tmpdir/pr21529.o
$ readelf -l tmpdir/dump-elf
Elf file type is EXEC (Executable file)
Entry point 0x10000004
There are 2 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x001000 0x10000000 0x10000000 0x00008 0x00008 R E 0x1000
LOAD 0x001ffc 0xbffffffc 0xbffffffc 0x00004 0x00004 RW 0x1000
Section to Segment mapping:
Segment Sections...
00 .text
01 .stack
$
and converted to padding with the use of the binary BFD for output from
producing unreasonably large files.
ld/
* testsuite/ld-unique/pr21529.ld: New test linker script.
* testsuite/ld-unique/pr21529.d: Use it.
Diff:
---
ld/ChangeLog | 5 +++++
ld/testsuite/ld-unique/pr21529.d | 2 +-
ld/testsuite/ld-unique/pr21529.ld | 5 +++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c3219bf..425a46f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-14 Maciej W. Rozycki <macro@imgtec.com>
+
+ * testsuite/ld-unique/pr21529.ld: New test linker script.
+ * testsuite/ld-unique/pr21529.d: Use it.
+
2017-07-12 Alan Modra <amodra@gmail.com>
* po/bg.po: Update from translationproject.org/latest/ld/.
diff --git a/ld/testsuite/ld-unique/pr21529.d b/ld/testsuite/ld-unique/pr21529.d
index 1bcd4fe..bc4763d 100644
--- a/ld/testsuite/ld-unique/pr21529.d
+++ b/ld/testsuite/ld-unique/pr21529.d
@@ -1,4 +1,4 @@
-#ld: --oformat binary -e main
+#ld: --oformat binary -T pr21529.ld -e main
#objdump: -s -b binary
#xfail: aarch64*-*-* arm*-*-* hppa-*-* ia64-*-* nds32*-*-* score-*-*
diff --git a/ld/testsuite/ld-unique/pr21529.ld b/ld/testsuite/ld-unique/pr21529.ld
new file mode 100644
index 0000000..113e70b
--- /dev/null
+++ b/ld/testsuite/ld-unique/pr21529.ld
@@ -0,0 +1,5 @@
+SECTIONS
+{
+ .text : { *(.text) }
+ /DISCARD/ : { *(*) }
+}