MIPS/LD/testsuite: mips-elf-flags: Use `remote_exec' to call `readelf'
authorMaciej W. Rozycki <macro@imgtec.com>
Tue, 27 Jun 2017 01:58:27 +0000 (02:58 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Tue, 27 Jun 2017 01:58:27 +0000 (02:58 +0100)
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.

ld/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf-flags.exp

index 0bc18760b5005bcc0ae108dd7e68a4065db2830e..529850d4599f0a9214e9499f6c0e290ca47ff02a 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-27  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * 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  <macro@imgtec.com>
 
        * testsuite/ld-mips-elf/mips-elf-flags.exp (good_combination):
index cea2774b52a338d3423656aad98f28b861918ed2..9461cb600e3745a7be82416b4c3dc7fd3b069edd 100644 (file)
@@ -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
This page took 0.029183 seconds and 4 git commands to generate.