aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-05-15 18:52:01 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2011-05-15 18:52:01 +0000
commit77c56f443d3ef7b5350fb3c7a27510840cb6bb4c (patch)
treeaf350d0d1cb57e62debbd8321ebbcac92aea205d /ld/testsuite
parent75fc9810e329b582cff578f08574432c90442fea (diff)
downloadgdb-77c56f443d3ef7b5350fb3c7a27510840cb6bb4c.zip
gdb-77c56f443d3ef7b5350fb3c7a27510840cb6bb4c.tar.gz
gdb-77c56f443d3ef7b5350fb3c7a27510840cb6bb4c.tar.bz2
bfd/
* elfxx-mips.c (_bfd_mips_elf_check_relocs): Record both local and global GOT entries for GOT_PAGE relocations against global symbols. ld/testsuite/ * lib/ld-lib.exp (run_ld_link_tests): Simplify pass/fail logic. Fail if the link command fails and if no test rules are defined. * ld-mips-elf/reloc-6a.s, ld-mips-elf/reloc-6b.s: New tests. * ld-mips-elf/mips-elf.exp: Run them.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp12
-rw-r--r--ld/testsuite/ld-mips-elf/reloc-6a.s11
-rw-r--r--ld/testsuite/ld-mips-elf/reloc-6b.s11
-rw-r--r--ld/testsuite/lib/ld-lib.exp28
5 files changed, 49 insertions, 20 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index ba0aa43..11383be 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-15 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lib/ld-lib.exp (run_ld_link_tests): Simplify pass/fail logic.
+ Fail if the link command fails and if no test rules are defined.
+ * ld-mips-elf/reloc-6a.s, ld-mips-elf/reloc-6b.s: New tests.
+ * ld-mips-elf/mips-elf.exp: Run them.
+
2011-05-13 Bernd Schmidt <bernds@codesourcery.com>
* ld-tic6x/dsbt.ld (OUTPUT_FORMAT): Add.
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 2361965..372f454 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -298,6 +298,18 @@ if {$has_newabi} {
}
run_dump_test "reloc-4"
run_dump_test "reloc-5"
+if { $has_newabi } {
+ run_ld_link_tests {
+ {"reloc test 6a" "-shared"
+ "-n32" "reloc-6a.s"
+ {}
+ "reloc-6a.so"}
+ {"reloc test 6b" "tmpdir/reloc-6a.so"
+ "-n32" "reloc-6b.s"
+ {}
+ "reloc-6b"}
+ }
+}
if {$has_newabi && $linux_gnu} {
run_dump_test "eh-frame1-n32"
diff --git a/ld/testsuite/ld-mips-elf/reloc-6a.s b/ld/testsuite/ld-mips-elf/reloc-6a.s
new file mode 100644
index 0000000..4d84e83
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/reloc-6a.s
@@ -0,0 +1,11 @@
+ .globl us
+ .globl gs
+us:
+gs:
+ls:
+ lw $4,%got_page(us)($gp)
+ addiu $4,$4,%got_ofst(us)
+ lw $4,%got_page(gs)($gp)
+ addiu $4,$4,%got_ofst(gs)
+ lw $4,%got_page(ls)($gp)
+ addiu $4,$4,%got_ofst(ls)
diff --git a/ld/testsuite/ld-mips-elf/reloc-6b.s b/ld/testsuite/ld-mips-elf/reloc-6b.s
new file mode 100644
index 0000000..aa2a726
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/reloc-6b.s
@@ -0,0 +1,11 @@
+ .globl __start
+ .globl gs
+__start:
+gs:
+ls:
+ lw $4,%got_page(us)($gp)
+ addiu $4,$4,%got_ofst(us)
+ lw $4,%got_page(gs)($gp)
+ addiu $4,$4,%got_ofst(gs)
+ lw $4,%got_page(ls)($gp)
+ addiu $4,$4,%got_ofst(ls)
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 2fb8c4a..34de7c8 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -978,26 +978,21 @@ proc run_ld_link_tests { ldtests } {
}
# Catch assembler errors.
- if { $is_unresolved != 0 } {
+ if { $is_unresolved } {
unresolved $testname
continue
}
if { [regexp ".*\\.a$" $binfile] } {
if { ![ar_simple_create $ar $ld_options $binfile "$objfiles"] } {
- fail $testname
set failed 1
- } else {
- set failed 0
}
} elseif { ![ld_simple_link $ld $binfile "-L$srcdir/$subdir $ld_options $objfiles"] } {
set maybe_failed 1
set ld_output "$exec_output"
- } else {
- set failed 0
}
- if { $failed == 0 } {
+ if { !$failed } {
foreach actionlist $actions {
set action [lindex $actionlist 0]
set progopts [lindex $actionlist 1]
@@ -1034,10 +1029,7 @@ proc run_ld_link_tests { ldtests } {
break
}
set maybe_failed 0
- } elseif { $maybe_failed != 0 } {
- set failed 1
- break
- } elseif { $dump_prog != "" } {
+ } elseif { !$maybe_failed && $dump_prog != "" } {
set dumpfile [lindex $actionlist 2]
set binary $dump_prog
@@ -1079,18 +1071,14 @@ proc run_ld_link_tests { ldtests } {
remote_file host delete "dump.out"
}
}
-
- if { $failed != 0 } {
- fail $testname
- } else { if { $is_unresolved == 0 } {
- pass $testname
- } }
}
- # Catch action errors.
- if { $is_unresolved != 0 } {
+ if { $is_unresolved } {
unresolved $testname
- continue
+ } elseif { $maybe_failed || $failed } {
+ fail $testname
+ } else {
+ pass $testname
}
}
}