aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/testsuite/ld-undefined/undefined.exp26
2 files changed, 28 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index b15d726..0ccc02b 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-26 Maciej W. Rozycki <macro@imgtec.com>
+
+ * testsuite/ld-undefined/undefined.exp: Correct the dyn reloc
+ test for MIPS and S+core targets.
+
2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22150
diff --git a/ld/testsuite/ld-undefined/undefined.exp b/ld/testsuite/ld-undefined/undefined.exp
index c0c9012..1421383 100644
--- a/ld/testsuite/ld-undefined/undefined.exp
+++ b/ld/testsuite/ld-undefined/undefined.exp
@@ -195,10 +195,30 @@ if { ![is_elf_format] || ![check_shared_lib_support]} then {
set exec_output [run_host_cmd "$READELF" "-r tmpdir/fundef.so"]
set exec_output [prune_warnings $exec_output]
- # we ought to get two .rel{a}.plt and three .rel{a}.dyn relocs
+ # We ought to get two .rel{a}.plt and three .rel{a}.dyn relocs,
+ # except for MIPS targets whose psABI mandates an extra
+ # R_MIPS_NONE relocation, also used to pad n64 relocation
+ # triplets, and S+core targets using an extra R_SCORE_NONE
+ # relocation, so adjust for that.
+ switch -glob $target_triplet {
+ "mips64*-*-openbsd*" {
+ set none_count 6
+ set reloc_count 4
+ }
+ "mips*" -
+ "score*" {
+ set none_count 1
+ set reloc_count 4
+ }
+ "*" {
+ set none_count 0
+ set reloc_count 3
+ }
+ }
+
if { ($asflags == "" || [regexp ".* contains 2 .*" $exec_output])
- && [regexp ".* contains 3 .*" $exec_output]
- && ![regexp "_NONE" $exec_output]} then {
+ && [regexp ".* contains $reloc_count .*" $exec_output]
+ && [regexp -all "_NONE" $exec_output] == $none_count } then {
pass "$testname (dyn reloc)"
} else {
fail "$testname (dyn reloc)"