This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/binutils-2_26-branch] Link tmpdir/copyreloc-main.o before tmpdir/copyreloc-lib.so


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca7db4787c6d43376b44827b1ee7a9561696cb68

commit ca7db4787c6d43376b44827b1ee7a9561696cb68
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Mar 6 08:26:49 2016 -0800

    Link tmpdir/copyreloc-main.o before tmpdir/copyreloc-lib.so
    
    Since compiler may pass --as-needed to ld by default, link
    tmpdir/copyreloc-main.o before tmpdir/copyreloc-lib.so.
    
    	* testsuite/ld-i386/i386.exp: Link tmpdir/copyreloc-main.o
    	before tmpdir/copyreloc-lib.so and test --as-needed.
    	* testsuite/ld-x86-64/x86-64.exp: Likewise.

Diff:
---
 ld/ChangeLog                      |  6 ++++++
 ld/testsuite/ld-i386/i386.exp     | 20 ++++++++++++++------
 ld/testsuite/ld-x86-64/x86-64.exp | 20 ++++++++++++++------
 3 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index f26ee23..7594fac 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -17,6 +17,12 @@
 	* testsuite/ld-x86-64/x86-64.exp: Link tmpdir/pr18900.o before
 	tmpdir/pr18900.so and test --as-needed.
 
+	2016-03-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* testsuite/ld-i386/i386.exp: Link tmpdir/copyreloc-main.o
+	before tmpdir/copyreloc-lib.so and test --as-needed.
+	* testsuite/ld-x86-64/x86-64.exp: Likewise.
+
 2016-05-20  H.J. Lu  <hongjiu.lu@intel.com>
 
 	Backport from master
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 02e6769..be45649 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -423,18 +423,26 @@ if { [isnative]
 	    "copyreloc-lib.so" \
 	] \
 	[list \
-	    "Build copyreloc-main with PIE and GOTOFF (1)" \
-	    "tmpdir/copyreloc-lib.so -pie" \
+	    "Build libcopyreloc-main.a" \
+	    "" \
 	    "" \
 	    { copyreloc-main.S } \
+	    {} \
+	    "libcopyreloc-main.a" \
+	] \
+	[list \
+	    "Build copyreloc-main with PIE and GOTOFF (1)" \
+	    "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
+	    "" \
+	    { dummy.s } \
 	    {{readelf {-Wr} copyreloc-main1.rd}} \
 	    "copyreloc-main" \
 	] \
 	[list \
 	    "Build copyreloc-main with PIE and GOTOFF (2)" \
-	    "tmpdir/copyreloc-lib.so -pie" \
+	    "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
 	    "" \
-	    { copyreloc-main.S } \
+	    { dummy.s } \
 	    {{readelf {-Wr} copyreloc-main2.rd}} \
 	    "copyreloc-main" \
 	] \
@@ -606,9 +614,9 @@ if { [isnative]
 	] \
 	[list \
 	    "Run copyreloc-main with PIE and GOTOFF" \
-	    "tmpdir/copyreloc-lib.so -pie" \
+	    "--as-needed tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
 	    "" \
-	    { copyreloc-main.S } \
+	    { dummy.s } \
 	    "copyreloc-main" \
 	    "copyreloc-main.out" \
 	] \
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index c80f846..484d5e3 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -459,18 +459,26 @@ if { [isnative] && [which $CC] != 0 } {
 	    "copyreloc-lib.so" \
 	] \
 	[list \
-	    "Build copyreloc-main with PIE without -fPIE (1)" \
-	    "tmpdir/copyreloc-lib.so -pie" \
+	    "Build libcopyreloc-main.a" \
+	    "" \
 	    "" \
 	    { copyreloc-main.S } \
+	    {} \
+	    "libcopyreloc-main.a" \
+	] \
+	[list \
+	    "Build copyreloc-main with PIE without -fPIE (1)" \
+	    "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
+	    "" \
+	    { dummy.s } \
 	    {{readelf {-Wr} copyreloc-main1.rd}} \
 	    "copyreloc-main" \
 	] \
 	[list \
 	    "Build copyreloc-main with PIE without -fPIE (2)" \
-	    "tmpdir/copyreloc-lib.so -pie" \
+	    "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
 	    "" \
-	    { copyreloc-main.S } \
+	    { dummy.s } \
 	    {{readelf {-Wr} copyreloc-main2.rd}} \
 	    "copyreloc-main" \
 	] \
@@ -625,9 +633,9 @@ if { [isnative] && [which $CC] != 0 } {
 	] \
 	[list \
 	    "Run copyreloc-main with PIE without -fPIE" \
-	    "tmpdir/copyreloc-lib.so -pie" \
+	    "--as-needed tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
 	    "" \
-	    { copyreloc-main.S } \
+	    { dummy.s } \
 	    "copyreloc-main" \
 	    "copyreloc-main.out" \
 	] \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]