This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_26-branch] Update x86-64 tests for --as-needed
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 12 Jun 2016 04:41:12 -0000
- Subject: [binutils-gdb/binutils-2_26-branch] Update x86-64 tests for --as-needed
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=576bc8b56185fb707d72c8c5381793133aef5ec5
commit 576bc8b56185fb707d72c8c5381793133aef5ec5
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Apr 13 05:41:36 2016 -0700
Update x86-64 tests for --as-needed
Since compiler may pass --as-needed to ld by default, link .o file
before .so file in x86-64 tests.
PR ld/19774
* testsuite/ld-x86-64/x86-64.exp: Link tmpdir/pr17689b.o before
tmpdir/pr17689.so, fix gotpcrel1 test and add more --as-needed
tests.
Diff:
---
ld/ChangeLog | 7 +++++++
ld/testsuite/ld-x86-64/x86-64.exp | 39 +++++++++++++++++++++++++++------------
2 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 2e5b80e..f26ee23 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,6 +1,13 @@
2016-06-11 H.J. Lu <hongjiu.lu@intel.com>
Backport from master
+ 2016-04-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/19774
+ * testsuite/ld-x86-64/x86-64.exp: Link tmpdir/pr17689b.o before
+ tmpdir/pr17689.so, fix gotpcrel1 test and add more --as-needed
+ tests.
+
2016-03-07 H.J. Lu <hongjiu.lu@intel.com>
PR ld/19774
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 92236fb..c80f846 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -491,26 +491,33 @@ if { [isnative] && [which $CC] != 0 } {
"pr17689now.so" \
] \
[list \
- "Build pr17689 with PIE without -fPIE" \
- "tmpdir/pr17689.so -pie" \
+ "Build pr17689b.o" \
+ "" \
"" \
{ pr17689b.S } \
+ {} \
+ ] \
+ [list \
+ "Build pr17689 with PIE without -fPIE" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
+ "" \
+ { dummy.s } \
{{readelf {-Wr} pr17689.rd}} \
"pr17689" \
] \
[list \
"Build pr17689 with PIE -z now without -fPIE" \
- "tmpdir/pr17689.so -pie -Wl,-z,now" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now" \
"" \
- { pr17689b.S } \
+ { dummy.s } \
{{readelf {-Wr} pr17689now.rd}} \
"pr17689now" \
] \
[list \
"Build pr17827 with PIE without -fPIE" \
- "tmpdir/pr17689.so -pie" \
+ "-Wl,--as-needed tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
"" \
- { pr17689b.S } \
+ { dummy.s } \
{{readelf {-Wr} pr17827.rd}} \
"pr17827" \
] \
@@ -563,10 +570,18 @@ if { [isnative] && [which $CC] != 0 } {
"gotpcrel1d.so" \
] \
[list \
+ "Build libgotpcrel1.a" \
+ "" \
+ "" \
+ { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c } \
+ "" \
+ "libgotpcrel1.a" \
+ ] \
+ [list \
"Build gotpcrel1" \
- "tmpdir/gotpcrel1d.so" \
+ "-Wl,--as-needed tmpdir/gotpcrel1a.o tmpdir/gotpcrel1b.o tmpdir/gotpcrel1c.o tmpdir/gotpcrel1d.so" \
"-Wa,-mrelax-relocations=yes" \
- { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c } \
+ { dummy.s } \
{{objdump {-dw} gotpcrel1.dd}} \
"gotpcrel1" \
] \
@@ -618,17 +633,17 @@ if { [isnative] && [which $CC] != 0 } {
] \
[list \
"Run pr17689 with PIE without -fPIE" \
- "tmpdir/pr17689.so -pie" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
"" \
- { pr17689b.S } \
+ { dummy.s } \
"pr17689" \
"pr17689.out" \
] \
[list \
"Run pr17689 with PIE -z now without -fPIE" \
- "tmpdir/pr17689.so -pie -z now" \
+ "--as-needed tmpdir/pr17689b.o tmpdir/pr17689.so -pie -z now" \
"" \
- { pr17689b.S } \
+ { dummy.s } \
"pr17689now" \
"pr17689.out" \
] \