aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-03-20 02:28:17 +0000
committerAlan Modra <amodra@gmail.com>2013-03-20 02:28:17 +0000
commit75c8d84d74c6c361a7f0c6371e94eb14ff7651d5 (patch)
treed115e0edc25231c7d338fddf13e947472565d7d1 /ld
parent32e2b61d0baceacdd0ae791adc12bf829499be96 (diff)
downloadgdb-75c8d84d74c6c361a7f0c6371e94eb14ff7651d5.zip
gdb-75c8d84d74c6c361a7f0c6371e94eb14ff7651d5.tar.gz
gdb-75c8d84d74c6c361a7f0c6371e94eb14ff7651d5.tar.bz2
* ld-elfvers/vers.exp: Add -Wl,--no-as-needed to all tests
linking against shared libraries. * ld-elfweak/elfweak.exp: Likewise. Enable for x86_64-linux. Build main1.o using $picflag.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-elfvers/vers.exp12
-rw-r--r--ld/testsuite/ld-elfweak/elfweak.exp20
3 files changed, 24 insertions, 16 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index c14d579..9d2fe1b 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2013-03-20 Alan Modra <amodra@gmail.com>
+ Will Newton <will.newton@linaro.org
+
+ * ld-elfvers/vers.exp: Add -Wl,--no-as-needed to all tests
+ linking against shared libraries.
+ * ld-elfweak/elfweak.exp: Likewise. Enable for x86_64-linux.
+ Build main1.o using $picflag.
+
2013-03-18 Alan Modra <amodra@gmail.com>
* ld-elf/pr14862.out: Expect no output.
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 39ee1b0..6051f71 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -796,7 +796,7 @@ build_vers_lib_pic "vers2" vers2.c vers2 vers1.so vers2.map vers2.ver vers2.dsym
#
# Test #3 - build an executable, and link it against vers1.so.
#
-build_exec "vers3" vers3.c vers3 "" vers1.so vers3.ver vers3.dsym ""
+build_exec "vers3" vers3.c vers3 "-Wl,--no-as-needed" vers1.so vers3.ver vers3.dsym ""
#
# Test #4 - Make sure a version implicitly defined in an executable
@@ -827,7 +827,7 @@ test_ldfail "vers5" "" vers5.c vers5 "" "" "multiple definition of foo@VERS_1.2"
# Now build a test that should reference a bunch of versioned symbols.
# All of them should be correctly referenced.
#
-build_exec "vers6" vers6.c vers6 "" vers1.so vers6.ver vers6.dsym vers6.sym
+build_exec "vers6" vers6.c vers6 "-Wl,--no-as-needed" vers1.so vers6.ver vers6.dsym vers6.sym
#
# Another test to verify that something made local via 'local' is truly not
@@ -894,12 +894,12 @@ build_exec "vers15" vers15.c vers15 "-Wl,--no-as-needed" vers1.so vers15.ver ver
# symbol appears in the dynamic symbol table of the executable.
#
build_vers_lib_pic "vers16a" vers16a.c vers16a "" vers16.map vers16a.ver vers16a.dsym ""
-build_exec "vers16" vers16.c vers16 "" vers16a.so "" vers16.dsym ""
+build_exec "vers16" vers16.c vers16 "-Wl,--no-as-needed" vers16a.so "" vers16.dsym ""
# Test a weak versioned symbol.
build_vers_lib_pic "vers17" vers17.c vers17 "" vers17.map vers17.ver vers17.dsym ""
build_vers_lib_pic "vers18" vers18.c vers18 vers17.so vers18.map vers18.ver vers18.dsym vers18.sym
-build_exec "vers19" vers19.c vers19 "-Wl,-rpath,. -Wl,-rpath-link,." vers18.so vers19.ver vers19.dsym ""
+build_exec "vers19" vers19.c vers19 "-Wl,-rpath,. -Wl,-rpath-link,--no-as-needed" vers18.so vers19.ver vers19.dsym ""
build_vers_lib_no_pic "vers20a" vers20.c vers20a "" vers20.map vers20a.ver vers20.dsym ""
exec cp $tmpdir/vers20a.so $tmpdir/vers20b.so
@@ -924,8 +924,8 @@ if [string match "yes" $pic] then {
build_vers_lib_no_pic "vers23a" vers23a.c vers23a "" vers23a.map vers23a.ver vers23a.dsym vers23a.sym
build_vers_lib_no_pic "vers23b" vers23b.c vers23b "" vers23b.map vers23b.ver vers23b.dsym ""
build_vers_lib_no_pic "vers23c" vers23b.c vers23c "vers23a.so" vers23b.map vers23c.ver vers23b.dsym ""
- build_exec "vers23d" vers23.c vers23d "tmpdir/vers23a.so tmpdir/vers23c.so" "" vers23.ver vers23d.dsym ""
- build_exec "vers23" vers23.c vers23 "tmpdir/vers23a.so tmpdir/vers23b.o tmpdir/vers23b.so" "" vers23.ver vers23.dsym ""
+ build_exec "vers23d" vers23.c vers23d "-Wl,--no-as-needed tmpdir/vers23a.so tmpdir/vers23c.so" "" vers23.ver vers23d.dsym ""
+ build_exec "vers23" vers23.c vers23 "-Wl,--no-as-needed tmpdir/vers23a.so tmpdir/vers23b.o tmpdir/vers23b.so" "" vers23.ver vers23.dsym ""
}
# Test .symver x,x@VERS.0
diff --git a/ld/testsuite/ld-elfweak/elfweak.exp b/ld/testsuite/ld-elfweak/elfweak.exp
index 91e683b..3a27465 100644
--- a/ld/testsuite/ld-elfweak/elfweak.exp
+++ b/ld/testsuite/ld-elfweak/elfweak.exp
@@ -50,6 +50,7 @@ if { ![istarget alpha*-*-linux*]
&& ![istarget sparc*-*-elf]
&& ![istarget sparc*-*-solaris2*]
&& ![istarget sparc*-*-linux*]
+ && ![istarget x86_64-*-linux*]
&& ![istarget *-*-nacl*] } {
return
}
@@ -67,7 +68,7 @@ set diff diff
set tmpdir tmpdir
set DOBJDUMP_FLAGS --dynamic-syms
set SOBJDUMP_FLAGS --syms
-set shared --shared
+set shared "--shared -Wl,--no-as-needed"
# <http://www.gnu.org/software/hurd/open_issues/binutils.html#weak>
@@ -316,7 +317,6 @@ proc build_exec { test execname objs flags dat dynsymexp symexp} {
global CC
global objdump
global tmpdir
- global shared
global srcdir
global subdir
global exec_output
@@ -442,7 +442,7 @@ if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/bar1c.c $tmpdir/bar1c.o]
return
}
-if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main1.c $tmpdir/main1.o] {
+if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/main1.c $tmpdir/main1.o] {
unresolved "ELF weak"
return
}
@@ -469,9 +469,9 @@ build_lib "ELF DSO weak func last DSO" libfoo "libbar.so foo.o" dsow.dsym
build_exec "ELF weak func first" foo "main.o bar.o" "" strong "" strong.sym
build_exec "ELF weak func last" foo "bar.o main.o" "" strong "" strong.sym
setup_xfail_gnu_hurd
-build_exec "ELF weak func first DSO" foo "main.o libbar.so" "-Wl,-rpath,." weak weak.dsym ""
+build_exec "ELF weak func first DSO" foo "main.o libbar.so" "-Wl,-rpath,.,--no-as-needed" weak weak.dsym ""
setup_xfail_gnu_hurd
-build_exec "ELF weak func last DSO" foo "libbar.so main.o" "-Wl,-rpath,." weak weak.dsym ""
+build_exec "ELF weak func last DSO" foo "libbar.so main.o" "-Wl,-rpath,.,--no-as-needed" weak weak.dsym ""
build_lib "ELF DSO weak data first" libfoo "bar1a.o foo1a.o" dsodata.dsym
build_lib "ELF DSO weak data last" libfoo "foo1a.o bar1a.o" dsodata.dsym
@@ -484,13 +484,13 @@ build_exec "ELF weak data last" foo "foo1a.o main1.o bar1a.o" "" strongdata "" s
build_exec "ELF weak data first common" foo "main1.o bar1a.o foo1b.o" "" strongdata "" strongcomm.sym
build_exec "ELF weak data last common" foo "foo1b.o main1.o bar1a.o" "" strongdata "" strongcomm.sym
setup_xfail_gnu_hurd
-build_exec "ELF weak data first DSO" foo "main1.o libbar1a.so libfoo1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+build_exec "ELF weak data first DSO" foo "main1.o libbar1a.so libfoo1a.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym ""
setup_xfail_gnu_hurd
-build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o libbar1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o libbar1a.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym ""
setup_xfail_gnu_hurd
-build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym ""
setup_xfail_gnu_hurd
-build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym ""
if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/size_foo.c $tmpdir/size_foo.o] {
unresolved "ELF weak (size)"
@@ -517,7 +517,7 @@ if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/size_main.c $tmpdir/size_main.o] {
return
}
-build_exec "ELF weak size" size_main "size_main.o libsize_foo.so libsize_bar.so" "-Wl,-rpath,." size "" ""
+build_exec "ELF weak size" size_main "size_main.o libsize_foo.so libsize_bar.so" "-Wl,-rpath,.,--no-as-needed" size "" ""
verbose "size2"
run_dump_test $srcdir/$subdir/size2