This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
- From: Jan-Benedict Glaw <jbglaw at microdata-pos dot de>
- To: binutils at sources dot redhat dot com
- Date: Fri, 25 Mar 2005 18:12:22 +0100
- Subject: Re: [PATCH-RFC] Testcase(s) for VAX' new -M entry:0xf00 feature
- References: <20050324234026.B28283@microdata-pos.de>
On Thu, Mar 24, 2005 at 11:40:26PM +0100, Jan-Benedict Glaw wrote:
> diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s
> --- src-fresh/binutils/testsuite/binutils-all/vax/entrymask.s 1970-01-01 01:00:00.000000000 +0100
> +++ src-hacked/binutils/testsuite/binutils-all/vax/entrymask.s 2005-03-24 23:00:50.000000000 +0100
> @@ -0,0 +1,11 @@
> +.text
> +
> +.global label1
> +label1:
> + .word 0x0110
> +
> +.global label2
> +.type label2,@function
> +label2:
> + .word 0x0224
> +
I've built this for vax-netbsd and vax-netbsdelf. The ELF variant
works as expected, but vax-netbsd (a.out) seems to ignore the
".type label2,@function" and thus objdump -d won't disassemble
label2 as a function.
I'd modify the test in two ways, which one do you think is preferrable:
- Exclude non-ELF targets from the test (how do I do that?)
- Also add a -M entry:0x... for label2 (which I'd prefer to do)
I'll intentionally keep /most/ of the rest of the patch, in case
someone wants to make a suggestion, but drop comments:
> diff -Nurp src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp
> --- src-fresh/binutils/testsuite/binutils-all/vax/objdump.exp 1970-01-01 01:00:00.000000000 +0100
> +++ src-hacked/binutils/testsuite/binutils-all/vax/objdump.exp 2005-03-24 23:06:53.000000000 +0100
> @@ -0,0 +1,82 @@
> +if ![istarget vax*-*-*] then {
> + return
> +}
> +
> +if {[which $OBJDUMP] == 0} then {
> + perror "$OBJDUMP does not exist"
> + return
> +}
> +
> +send_user "Version [binutil_version $OBJDUMP]"
> +
> +if {![binutils_assemble $srcdir/$subdir/entrymask.s tmpdir/entrymask.o]} then {
> + return
> +}
> +
> +if [is_remote host] {
> + set objfile [remote_download host tmpdir/entrymask.o]
> +} else {
> + set objfile tmpdir/entrymask.o
> +}
> +
> +set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d $objfile"]
> +set want1 "\[ \]+0:\[ \]+10 01\[ \]+bsbb 3"
> +set want2 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
> +if [regexp $want1 $got] then {
> + pass "entrymask test 1"
> +} else {
> + fail "entrymask test 1"
> +}
> +if [regexp $want2 $got] then {
> + pass "entrymask test 2"
> +} else {
> + fail "entrymask test 2"
> +}
> +
> +set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 $objfile"]
> +set want3 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
> +set want4 "\[ \]+2:\[ \]+24 02\[ \]+\\.word 0x0224.\*r9 r5 r2"
> +if [regexp $want3 $got] then {
> + pass "entrymask test 3"
> +} else {
> + fail "entrymask test 3"
> +}
> +if [regexp $want4 $got] then {
> + pass "entrymask test 4"
> +} else {
> + fail "entrymask test 4"
> +}
> +
Thanks, JBG
--
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld