From 7ed1dab994fa1c0cf49d10608b8e77271c9804b4 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 9 Aug 2017 16:32:30 -0700 Subject: [PATCH] LD_CLASS: Check .libs/ld-new for linker first When --enable-shared is used, ./ld-new may be a shell script and the real linker is .libs/ld-new. We should check .libs/ld-new first. * testsuite/config/default.exp (LD_CLASS): Check .libs/ld-new for linker first. --- ld/ChangeLog | 5 +++++ ld/testsuite/config/default.exp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index e4e6bfe5e32..b0191cfcce8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2017-08-09 H.J. Lu + + * testsuite/config/default.exp (LD_CLASS): Check .libs/ld-new + for linker first. + 2017-08-09 H.J. Lu * testsuite/config/default.exp (LD_CLASS): New. Set to "64bit" diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 355d98f24a8..6aba75fdc59 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -253,7 +253,8 @@ if ![info exists LDFLAGS] then { # Set LD_CLASS to "64bit" for 64-bit LD. if { ![info exists LD_CLASS] } then { - set readelf_output [run_host_cmd "$READELF" "-h $LD"] + set REAL_LD [findfile $base_dir/.libs/ld-new .libs/ld-new $LD [transform ld]] + set readelf_output [run_host_cmd "$READELF" "-h $REAL_LD"] if { [regexp {[ \t]+Class:[ \t]+ELF64} $readelf_output] } then { set LD_CLASS "64bit" } else { -- 2.30.2