aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitar Dimitrov <dimitar@dinux.eu>2017-01-18 12:23:19 +0000
committerNick Clifton <nickc@redhat.com>2017-01-18 12:23:19 +0000
commit319b82e47dd12d6554e17a2ceedd3139b88ba55f (patch)
tree1adbb74f4deaff023c06e58abeb33d67b65d653a
parent6bb21700abb61cdb62a3d9fdf417971d528d5a37 (diff)
downloadgdb-319b82e47dd12d6554e17a2ceedd3139b88ba55f.zip
gdb-319b82e47dd12d6554e17a2ceedd3139b88ba55f.tar.gz
gdb-319b82e47dd12d6554e17a2ceedd3139b88ba55f.tar.bz2
Skip linker tests for unique symbols in shared libraries if the target does not support building shared libraries.
ld * testsuite/ld-unique/unique.exp: Filter shared lib cases in uniqeue.exp, as not all targets have such support.
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/testsuite/ld-unique/unique.exp60
2 files changed, 41 insertions, 24 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e587cf9..ec562dc 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-17 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * testsuite/ld-unique/unique.exp: Filter shared lib cases in
+ uniqeue.exp, as not all targets have such support.
+
2017-01-16 Nick Clifton <nickc@redhat.com>
* po/sv.po: Updated Swedish translation.
diff --git a/ld/testsuite/ld-unique/unique.exp b/ld/testsuite/ld-unique/unique.exp
index 668ac95..0aecf01 100644
--- a/ld/testsuite/ld-unique/unique.exp
+++ b/ld/testsuite/ld-unique/unique.exp
@@ -108,36 +108,12 @@ if ![ld_compile "$CC -c" "$srcdir/$subdir/unique_empty.s" "tmpdir/unique_empty.o
set fails [expr $fails + 1]
}
-# Create pic object file containing unique symbol.
-if ![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/unique_shared.s" "tmpdir/unique_shared.o"] {
- fail "Could not create a pic unique object"
- set fails [expr $fails + 1]
-}
-
# Create executable containing unique symbol.
if ![ld_link $CC "tmpdir/unique_prog" "tmpdir/unique.o"] {
fail "Could not link a unique executable"
set fails [expr $fails + 1]
}
-# Create shared library containing unique symbol.
-if ![ld_link $ld "tmpdir/libunique_shared.so" "-shared tmpdir/unique_shared.o"] {
- fail "Could not create a shared library containing an unique symbol"
- set fails [expr $fails + 1]
-}
-
-# Create executable NOT containing unique symbol linked against library.
-if ![ld_link $CC "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] {
- fail "Could not link a dynamic executable"
- set fails [expr $fails + 1]
-}
-
-# Create shared library containing unique symbol with reference.
-if ![ld_link $ld "tmpdir/libunique_shared_ref.so" "-shared tmpdir/unique_shared.o tmpdir/unique_empty.o"] {
- fail "Could not create a shared library containing an unique symbol with reference"
- set fails [expr $fails + 1]
-}
-
if { $fails != 0 } {
return
}
@@ -191,6 +167,42 @@ if { $fails == 0 } {
pass "Checking empty unique object"
}
+# ------------------------------------------------------------------------------
+# Only shared library tests below.
+# ------------------------------------------------------------------------------
+
+if { ![check_shared_lib_support] } {
+ return
+}
+
+# Create pic object file containing unique symbol.
+if {![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/unique_shared.s" "tmpdir/unique_shared.o"] } {
+ fail "Could not create a pic unique object"
+ set fails [expr $fails + 1]
+}
+
+# Create shared library containing unique symbol.
+if {![ld_link $ld "tmpdir/libunique_shared.so" "-shared tmpdir/unique_shared.o"] } {
+ fail "Could not create a shared library containing an unique symbol"
+ set fails [expr $fails + 1]
+}
+
+# Create executable NOT containing unique symbol linked against library.
+if {![ld_link $CC "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] } {
+ fail "Could not link a dynamic executable"
+ set fails [expr $fails + 1]
+}
+
+# Create shared library containing unique symbol with reference.
+if {![ld_link $ld "tmpdir/libunique_shared_ref.so" "-shared tmpdir/unique_shared.o tmpdir/unique_empty.o"] } {
+ fail "Could not create a shared library containing an unique symbol with reference"
+ set fails [expr $fails + 1]
+}
+
+if { $fails != 0 } {
+ return
+}
+
# Check the unique PIC file.
if {! [check_osabi tmpdir/unique_shared.o {UNIX - GNU}]} {
fail "PIC Object containing unique does not have an OS/ABI field of GNU"