From: Maciej W. Rozycki Date: Tue, 27 Jun 2017 01:58:27 +0000 (+0100) Subject: MIPS/LD/testsuite: mips-elf-flags: Use `remote_exec' to call `readelf' X-Git-Tag: binutils-2_29~116 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1284e99a6ce362d342d6468e5caa39ddab574721;p=platform%2Fupstream%2Fbinutils.git MIPS/LD/testsuite: mips-elf-flags: Use `remote_exec' to call `readelf' For ELF file header flag verification done in `good_combination' in the `mips-elf-flags.exp' test script the version of `readelf' built along with the rest of binutils has to be used rather than any such executable already present on the build system, so that flags recognized by the tool match those supported by LD being tested. Use `remote_exec' as elsewhere in the LD test framework and also with GAS and LD used here, getting and arranging for extra reporting of `readelf' calls included in test logs on this occasion as well. ld/ * testsuite/ld-mips-elf/mips-elf-flags.exp (good_combination): Use `remote_exec' to call `readelf'. Log the command issued. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 0bc1876..529850d 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,6 +1,11 @@ 2017-06-27 Maciej W. Rozycki * testsuite/ld-mips-elf/mips-elf-flags.exp (good_combination): + Use `remote_exec' to call `readelf'. Log the command issued. + +2017-06-27 Maciej W. Rozycki + + * testsuite/ld-mips-elf/mips-elf-flags.exp (good_combination): Use `readelf -h' rather than `readelf --headers'. 2017-06-26 Maciej W. Rozycki diff --git a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp index cea2774..9461cb6 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp @@ -70,8 +70,13 @@ proc good_combination {arglist flags} { } elseif {![ld_link "$ld $ldemul" $finalobj "-r $objs"]} { fail $testname } else { - catch "exec $READELF -h $finalobj" output - if {![regexp "Flags: *(\[^\n\]*)" $output full gotflags]} { + set cmd "$READELF -h $finalobj" + send_log "$cmd\n" + set cmdret [remote_exec host [concat sh -c [list "$cmd 2>&1"]]] + set output [lindex $cmdret 1] + set cmdret [lindex $cmdret 0] + if {$cmdret != 0 \ + || ![regexp "Flags: *(\[^\n\r\]*)" $output full gotflags]} { unresolved $testname } else { set failed 0