diff options
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/future.exp | 20 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/lib/prelink-support.exp | 4 |
3 files changed, 24 insertions, 4 deletions
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp index 422342b..553f562 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -94,6 +94,26 @@ proc gdb_find_ldd {} { return $ldd } +proc gdb_find_objcopy {} { + global OBJCOPY_FOR_TARGET + if [info exists OBJCOPY_FOR_TARGET] { + set objcopy $OBJCOPY_FOR_TARGET + } else { + set objcopy [transform objcopy] + } + return $objcopy +} + +proc gdb_find_readelf {} { + global READELF_FOR_TARGET + if [info exists READELF_FOR_TARGET] { + set readelf $READELF_FOR_TARGET + } else { + set readelf [transform readelf] + } + return $readelf +} + proc gdb_default_target_compile {source destfile type options} { global target_triplet global tool_root_dir diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 05e66ef..5e3331a 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3944,7 +3944,7 @@ gdb_caching_proc gdb_skip_xml_test { # Return "" if no build-id found. proc build_id_debug_filename_get { exec } { set tmp [standard_output_file "${exec}-tmp"] - set objcopy_program [transform objcopy] + set objcopy_program [gdb_find_objcopy] set result [catch "exec $objcopy_program -j .note.gnu.build-id -O binary $exec $tmp" output] verbose "result is $result" @@ -3982,7 +3982,7 @@ proc gdb_gnu_strip_debug { dest args } { set debug_file "${dest}.debug" set strip_to_file_program [transform strip] - set objcopy_program [transform objcopy] + set objcopy_program [gdb_find_objcopy] set debug_link [file tail $debug_file] set stripped_file "${dest}.stripped" diff --git a/gdb/testsuite/lib/prelink-support.exp b/gdb/testsuite/lib/prelink-support.exp index bd10017..887a58e 100644 --- a/gdb/testsuite/lib/prelink-support.exp +++ b/gdb/testsuite/lib/prelink-support.exp @@ -20,7 +20,7 @@ proc section_get {exec section} { global subdir set tmp [standard_output_file section_get.tmp] - set objcopy_program [transform objcopy] + set objcopy_program [gdb_find_objcopy] set command "exec $objcopy_program -O binary --set-section-flags $section=A --change-section-address $section=0 -j $section $exec $tmp" verbose -log "command is $command" @@ -211,7 +211,7 @@ proc prelink_no {arg {name {}}} { # Skip prelink options. continue } - set readelf_program [transform readelf] + set readelf_program [gdb_find_readelf] set command "exec $readelf_program -WS $bin" verbose -log "command is $command" set result [catch $command output] |