summaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-08-09 15:04:05 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-08-09 15:04:05 -0700
commit978c05401b0f0ac7a94cca7db19b1dec0c5bd698 (patch)
tree1d61fa478e1633519daf55f5cb3588dcd5783a09 /ld/testsuite
parent0968fbae6b16ced72c356c14aaadfe366280a464 (diff)
downloadbinutils-gdb-978c05401b0f0ac7a94cca7db19b1dec0c5bd698.tar.gz
Run PR ld/17618 test only with 64-bit ELF linker
PR ld/17618 test requires 64-bit linker to run. Set LD_CLASS to "64bit" for 64-bit ELF linker and run PR ld/17618 test only if $LD_CLASS is "64bit". More checks can be added to support 64-bit linkers in non-ELF format. * testsuite/config/default.exp (LD_CLASS): New. Set to "64bit" for 64-bit ELF linker. * testsuite/ld-x86-64/pr17618.d (#notarget): Removed. * testsuite/ld-x86-64/x86-64.exp: Run pr17618 only for 64-bit linker.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/config/default.exp10
-rw-r--r--ld/testsuite/ld-x86-64/pr17618.d1
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp6
3 files changed, 15 insertions, 2 deletions
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index f5cb188478a..355d98f24a8 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -251,6 +251,16 @@ if ![info exists LDFLAGS] then {
set LDFLAGS {}
}
+# Set LD_CLASS to "64bit" for 64-bit LD.
+if { ![info exists LD_CLASS] } then {
+ set readelf_output [run_host_cmd "$READELF" "-h $LD"]
+ if { [regexp {[ \t]+Class:[ \t]+ELF64} $readelf_output] } then {
+ set LD_CLASS "64bit"
+ } else {
+ set LD_CLASS "32bit"
+ }
+}
+
# Set PLT_CFLAGS to "-fplt" if target compiler supports it.
if { ![info exists PLT_CFLAGS] } then {
diff --git a/ld/testsuite/ld-x86-64/pr17618.d b/ld/testsuite/ld-x86-64/pr17618.d
index b090aa0e18c..e640b4044ec 100644
--- a/ld/testsuite/ld-x86-64/pr17618.d
+++ b/ld/testsuite/ld-x86-64/pr17618.d
@@ -1,5 +1,4 @@
#name: PLT PC-relative offset overflow check
#as: --64
#ld: -shared -melf_x86_64
-#notarget: x86_64-*-linux*-gnux32
#error: .*PC-relative offset overflow in PLT entry for `bar'
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index ce29cc86346..0375da6aa64 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -1572,7 +1572,11 @@ run_ld_link_tests [list \
]
# Linux only tests
-run_dump_test "pr17618"
+global LD_CLASS
+if { "$LD_CLASS" == "64bit" } then {
+ # This test needs 64-bit linker.
+ run_dump_test "pr17618"
+}
run_dump_test "pltgot-1"
run_dump_test "pltgot-2"
run_dump_test "pr20830a"