aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-02-22 01:20:48 +0000
committerH.J. Lu <hjl.tools@gmail.com>2013-02-22 01:20:48 +0000
commit35399224a1844ef745704878db6ecc83d350386d (patch)
tree947a54ed3d1e69e22b78a17eada5d81225f81019 /ld/testsuite
parent757b8d94056f339ccb81836bdc781bcf6a90dc38 (diff)
downloadgdb-35399224a1844ef745704878db6ecc83d350386d.zip
gdb-35399224a1844ef745704878db6ecc83d350386d.tar.gz
gdb-35399224a1844ef745704878db6ecc83d350386d.tar.bz2
Set unique_global only for definition
bfd/ PR ld/15167 * elf64-ia64-vms.c (elf64_vms_link_add_object_symbols): Set unique_global only for definition. * elflink.c (_bfd_elf_merge_symbol): Don't set unique_global here. (elf_link_add_object_symbols): Set unique_global only for definition. ld/testsuite/ PR ld/15167 * ld-unique/unique.exp: Add a test for shared library with reference.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-unique/unique.exp18
2 files changed, 24 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 6d034f8..07a01a8 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+013-02-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/15167
+ * ld-unique/unique.exp: Add a test for shared library with
+ reference.
+
2013-02-19 Maciej W. Rozycki <macro@codesourcery.com>
* lib/ld-lib.exp (run_ld_link_tests): Add another argument, pass
diff --git a/ld/testsuite/ld-unique/unique.exp b/ld/testsuite/ld-unique/unique.exp
index 646e5ec..9bc65e0 100644
--- a/ld/testsuite/ld-unique/unique.exp
+++ b/ld/testsuite/ld-unique/unique.exp
@@ -145,6 +145,12 @@ if ![default_ld_link $ld "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_emp
set fails [expr $fails + 1]
}
+# Create shared library containing unique symbol with reference.
+if ![ld_simple_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
}
@@ -220,6 +226,17 @@ if {[contains_unique_symbol tmpdir/libunique_shared.so] != 1} {
set fails [expr $fails + 1]
}
+# Check the unique shared library with reference.
+if {! [check_osabi tmpdir/libunique_shared_ref.so {UNIX - GNU}]} {
+ fail "Shared library containing unique with reference does not have an OS/ABI field of GNU"
+ set fails [expr $fails + 1]
+}
+
+if {[contains_unique_symbol tmpdir/libunique_shared_ref.so] != 1} {
+ fail "Shared library containing unique with reference does not contain an UNIQUE symbol"
+ set fails [expr $fails + 1]
+}
+
if { $fails == 0 } {
pass "Checking unique PIC object"
}
@@ -245,6 +262,7 @@ if { $verbose < 1 } {
remote_file host delete "tmpdir/unique.o"
remote_file host delete "tmpdir/unique_shared.o"
remote_file host delete "tmpdir/libunique_shared.so"
+ remote_file host delete "tmpdir/libunique_shared_ref.so"
remote_file host delete "tmpdir/unique_prog"
remote_file host delete "tmpdir/unique_shared_prog"
}