This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix i686-nacl and x86_64-nacl pr21884 failures
On Sun, Aug 13, 2017 at 4:39 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Aug 13, 2017 at 2:37 AM, Alan Modra <amodra@gmail.com> wrote:
>> On Sat, Aug 12, 2017 at 08:25:42PM -0700, H.J. Lu wrote:
>>> On Sat, Aug 12, 2017 at 8:06 PM, Alan Modra <amodra@gmail.com> wrote:
>>> > OUTPUT_FORMAT in the script results in "./ld-new: target elf32-i386
>>> > not found" and similarly for the x86_64 test.
>>> >
>>> > * testsuite/ld-i386/pr21884.t: Remove unneeded format, arch and entry.
>>> > * testsuite/ld-x86-64/pr21884.t: Likewise.
>>> >
>>> > diff --git a/ld/testsuite/ld-i386/pr21884.t b/ld/testsuite/ld-i386/pr21884.t
>>> > index 9ec7dc8..fcb7bce 100644
>>> > --- a/ld/testsuite/ld-i386/pr21884.t
>>> > +++ b/ld/testsuite/ld-i386/pr21884.t
>>> > @@ -1,7 +1,3 @@
>>> > -OUTPUT_FORMAT("elf32-i386");
>>> > -OUTPUT_ARCH(i386);
>>> > -
>>>
>>> These are what triggered the bug. Please re-run the test without
>>> Nick's commit:
>>
>> I ran the test against the 2.29 release and saw it fail with a
>> segfault before I made the commit.
>>
>
> That isn't sufficient. I backed out Nick's commit on master branch
> and these 2 tests ares still passing now.
>
>
This is what I checked in and will backport it to 2.29 branch.
--
H.J.
From 34c4758cc210e2ca042b0373938e57fd6844f89d Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 13 Aug 2017 05:41:37 -0700
Subject: [PATCH] ld: Restore linker scripts in PR ld/21884 tests
OUTPUT_FORMAT in linker script of PR ld/21884 tests is needed to trigger
PR ld/21884. Restore linker scripts and add nacl versions of the same
tests.
* testsuite/ld-i386/i386.exp: Run pr21884-nacl.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr21884.d: Don't run on nacl targets.
* testsuite/ld-x86-64/pr21884.d: Likewise.
* testsuite/ld-i386/pr21884.t: Revert the last change.
* testsuite/ld-x86-64/pr21884.t: Likewise.
* testsuite/ld-i386/pr21884-nacl.d: New file.
* testsuite/ld-i386/pr21884-nacl.t: Likewise.
* testsuite/ld-x86-64/pr21884-nacl.d: Likewise.
* testsuite/ld-x86-64/pr21884-nacl.t: Likewise.
---
ld/ChangeLog | 13 +++++++++++++
ld/testsuite/ld-i386/i386.exp | 1 +
ld/testsuite/ld-i386/pr21884-nacl.d | 10 ++++++++++
ld/testsuite/ld-i386/pr21884-nacl.t | 11 +++++++++++
ld/testsuite/ld-i386/pr21884.d | 1 +
ld/testsuite/ld-i386/pr21884.t | 4 ++++
ld/testsuite/ld-x86-64/pr21884-nacl.d | 10 ++++++++++
ld/testsuite/ld-x86-64/pr21884-nacl.t | 11 +++++++++++
ld/testsuite/ld-x86-64/pr21884.d | 1 +
ld/testsuite/ld-x86-64/pr21884.t | 4 ++++
ld/testsuite/ld-x86-64/x86-64.exp | 1 +
11 files changed, 67 insertions(+)
create mode 100644 ld/testsuite/ld-i386/pr21884-nacl.d
create mode 100644 ld/testsuite/ld-i386/pr21884-nacl.t
create mode 100644 ld/testsuite/ld-x86-64/pr21884-nacl.d
create mode 100644 ld/testsuite/ld-x86-64/pr21884-nacl.t
diff --git a/ld/ChangeLog b/ld/ChangeLog
index fdd8d58c17..aad32493af 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,16 @@
+2017-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * testsuite/ld-i386/i386.exp: Run pr21884-nacl.
+ * testsuite/ld-x86-64/x86-64.exp: Likewise.
+ * testsuite/ld-i386/pr21884.d: Don't run on nacl targets.
+ * testsuite/ld-x86-64/pr21884.d: Likewise.
+ * testsuite/ld-i386/pr21884.t: Revert the last change.
+ * testsuite/ld-x86-64/pr21884.t: Likewise.
+ * testsuite/ld-i386/pr21884-nacl.d: New file.
+ * testsuite/ld-i386/pr21884-nacl.t: Likewise.
+ * testsuite/ld-x86-64/pr21884-nacl.d: Likewise.
+ * testsuite/ld-x86-64/pr21884-nacl.t: Likewise.
+
2017-08-13 Alan Modra <amodra@gmail.com>
* testsuite/ld-i386/pr21884.t: Remove unneeded format, arch and entry.
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 34f03e0470..27d622eab4 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -438,6 +438,7 @@ run_dump_test "property-x86-shstk5"
run_dump_test "pie1"
run_dump_test "pie1-nacl"
run_dump_test "pr21884"
+run_dump_test "pr21884-nacl"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr21884-nacl.d b/ld/testsuite/ld-i386/pr21884-nacl.d
new file mode 100644
index 0000000000..82daaaafe2
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr21884-nacl.d
@@ -0,0 +1,10 @@
+#source: dummy.s
+#as: --32
+#ld: -m elf_i386 -T pr21884-nacl.t -b binary
+#objdump: -b binary -s
+#target: i?86-*-nacl* x86_64-*-nacl*
+
+.*: file format binary
+
+Contents of section .data:
+#pass
diff --git a/ld/testsuite/ld-i386/pr21884-nacl.t b/ld/testsuite/ld-i386/pr21884-nacl.t
new file mode 100644
index 0000000000..3ffb56c070
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr21884-nacl.t
@@ -0,0 +1,11 @@
+OUTPUT_FORMAT("elf32-i386-nacl");
+OUTPUT_ARCH(i386);
+
+ENTRY(_start);
+SECTIONS {
+ . = 0x10000;
+ _start = . ;
+ .data : {
+ *(.data)
+ }
+}
diff --git a/ld/testsuite/ld-i386/pr21884.d b/ld/testsuite/ld-i386/pr21884.d
index dc212d3c68..ea73aa2a75 100644
--- a/ld/testsuite/ld-i386/pr21884.d
+++ b/ld/testsuite/ld-i386/pr21884.d
@@ -2,6 +2,7 @@
#as: --32
#ld: -m elf_i386 -T pr21884.t -b binary
#objdump: -b binary -s
+#notarget: i?86-*-nacl* x86_64-*-nacl*
.*: file format binary
diff --git a/ld/testsuite/ld-i386/pr21884.t b/ld/testsuite/ld-i386/pr21884.t
index fcb7bce20e..4cf8cdcaa3 100644
--- a/ld/testsuite/ld-i386/pr21884.t
+++ b/ld/testsuite/ld-i386/pr21884.t
@@ -1,3 +1,7 @@
+OUTPUT_FORMAT("elf32-i386");
+OUTPUT_ARCH(i386);
+
+ENTRY(_start);
SECTIONS {
. = 0x10000;
_start = . ;
diff --git a/ld/testsuite/ld-x86-64/pr21884-nacl.d b/ld/testsuite/ld-x86-64/pr21884-nacl.d
new file mode 100644
index 0000000000..88835055c3
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr21884-nacl.d
@@ -0,0 +1,10 @@
+#source: dummy.s
+#as: --64
+#ld: -m elf_x86_64 -T pr21884-nacl.t -b binary
+#objdump: -b binary -s
+#target: x86_64-*-nacl*
+
+.*: file format binary
+
+Contents of section .data:
+#pass
diff --git a/ld/testsuite/ld-x86-64/pr21884-nacl.t b/ld/testsuite/ld-x86-64/pr21884-nacl.t
new file mode 100644
index 0000000000..722312e081
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr21884-nacl.t
@@ -0,0 +1,11 @@
+OUTPUT_FORMAT("elf64-x86-64-nacl");
+OUTPUT_ARCH(i386:x86-64);
+
+ENTRY(_start);
+SECTIONS {
+ . = 0x10000;
+ _start = . ;
+ .data : {
+ *(.data)
+ }
+}
diff --git a/ld/testsuite/ld-x86-64/pr21884.d b/ld/testsuite/ld-x86-64/pr21884.d
index a62d8bc4f7..7a2a3f361c 100644
--- a/ld/testsuite/ld-x86-64/pr21884.d
+++ b/ld/testsuite/ld-x86-64/pr21884.d
@@ -2,6 +2,7 @@
#as: --64
#ld: -m elf_x86_64 -T pr21884.t -b binary
#objdump: -b binary -s
+#notarget: x86_64-*-nacl*
.*: file format binary
diff --git a/ld/testsuite/ld-x86-64/pr21884.t b/ld/testsuite/ld-x86-64/pr21884.t
index fcb7bce20e..edd20704c7 100644
--- a/ld/testsuite/ld-x86-64/pr21884.t
+++ b/ld/testsuite/ld-x86-64/pr21884.t
@@ -1,3 +1,7 @@
+OUTPUT_FORMAT("elf64-x86-64");
+OUTPUT_ARCH(i386:x86-64);
+
+ENTRY(_start);
SECTIONS {
. = 0x10000;
_start = . ;
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 0009fe321b..46311577e4 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -366,6 +366,7 @@ run_dump_test "property-x86-shstk4-x32"
run_dump_test "property-x86-shstk5"
run_dump_test "property-x86-shstk5-x32"
run_dump_test "pr21884"
+run_dump_test "pr21884-nacl"
if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
return
--
2.13.4