This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[RFA:] GAS testsuite: support readelf as dumping tool for run_dump_test
- To: binutils at sources dot redhat dot com
- Subject: [RFA:] GAS testsuite: support readelf as dumping tool for run_dump_test
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Tue, 27 Mar 2001 18:42:20 +0200
I'd like to use readelf as a dumping tool in GAS run_dump_tests,
as it provides for more detailed display than objdump for ELF
features. (There are bugs in dwarf2_emit_insn calls in the CRIS port.)
Ok to commit?
* lib/gas-defs.exp (run_dump_test): Support using readelf.
* config/default.exp: Default READELF and READELFFLAGS.
Index: gas-defs.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/lib/gas-defs.exp,v
retrieving revision 1.4
diff -c -p -r1.4 gas-defs.exp
*** gas-defs.exp 2000/03/31 18:54:24 1.4
--- gas-defs.exp 2001/03/27 16:26:52
***************
*** 1,4 ****
! # Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
--- 1,4 ----
! # Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
*************** proc gas_init { args } {
*** 242,249 ****
proc run_dump_test { name } {
global subdir srcdir
! global OBJDUMP NM AS OBJCOPY
! global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS
global host_triplet
if [string match "*/*" $name] {
--- 242,249 ----
proc run_dump_test { name } {
global subdir srcdir
! global OBJDUMP NM AS OBJCOPY READELF
! global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS
global host_triplet
if [string match "*/*" $name] {
*************** proc run_dump_test { name } {
*** 262,267 ****
--- 262,268 ----
set opts(objdump) {}
set opts(nm) {}
set opts(objcopy) {}
+ set opts(readelf) {}
set opts(name) {}
set opts(PROG) {}
set opts(source) {}
*************** proc run_dump_test { name } {
*** 290,295 ****
--- 291,298 ----
{ set program nm }
objcopy
{ set program objcopy }
+ readelf
+ { set program readelf }
default
{ perror "unrecognized program option $opts(PROG) in $file.d"
unresolved $subdir/$name
*************** proc run_dump_test { name } {
*** 298,304 ****
} else {
# Guess which program to run, by seeing which option was specified.
set program ""
! foreach p {objdump objcopy nm} {
if {$opts($p) != ""} {
if {$program != ""} {
perror "ambiguous dump program in $file.d"
--- 301,307 ----
} else {
# Guess which program to run, by seeing which option was specified.
set program ""
! foreach p {objdump objcopy nm readelf} {
if {$opts($p) != ""} {
if {$program != ""} {
perror "ambiguous dump program in $file.d"
Index: default.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/config/default.exp,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 default.exp
*** default.exp 1999/05/03 07:28:46 1.1.1.1
--- default.exp 2001/03/27 16:27:36
*************** if ![info exists OBJCOPYFLAGS] then {
*** 43,46 ****
--- 43,54 ----
set OBJCOPYFLAGS {}
}
+ if ![info exists READELF] then {
+ set READELF [findfile $base_dir/../../binutils/readelf]
+ }
+
+ if ![info exists READELFFLAGS] then {
+ set READELFFLAGS {}
+ }
+
gas_init
brgds, H-P