From 854efa68e8dedcb14b2830174ca814c6c8f215d0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 15 Jan 1996 23:14:52 +0000 Subject: [PATCH] * binutils-all/objcopy.exp: Use the lma, not the vma, when testing address adjustments. --- binutils/testsuite/ChangeLog | 10 +++++ binutils/testsuite/binutils-all/objcopy.exp | 47 +++++++++++++-------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index fbcfd5da3c2..873cb457cb5 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,13 @@ +Mon Jan 15 18:14:14 1996 Ian Lance Taylor + + * binutils-all/objcopy.exp: Use the lma, not the vma, when testing + address adjustments. + +Fri Dec 15 16:31:55 1995 Ian Lance Taylor + + * binutils-all/objdump.exp: Update objdump -i test for current + objdump output. + Mon Nov 27 15:15:09 1995 Ian Lance Taylor * binutils-all/objcopy.exp: Correct fail calls to always use the diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 5ee2a3646d3..a6e94c7aca9 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1994 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ if ![string match "" $got] then { setup_xfail "m68*-*-hpux*" "m68*-*-sunos*" "m68*-*-coff" "m68*-*-vxworks*" setup_xfail "m68*-ericsson-ose" "m68k*-motorola-sysv*" setup_xfail "i*86-*-linuxaout*" "i*86-*-aout*" - setup_xfail "i*86-*-sysv*" "i*86-*-isc*" "i*86-*-sco*" "i*86-*-coff" + setup_xfail "i*86-*-sysv3" "i*86-*-isc*" "i*86-*-sco*" "i*86-*-coff" setup_xfail "i*86-*-aix*" "i*86-*-go32*" setup_xfail "a29k-*-udi" "a29k-*-coff" "a29k-*-vxworks*" setup_xfail "i960-*-vxworks*" "i960-*-coff" @@ -88,7 +88,8 @@ if ![string match "" $got] then { send_log "$line\n" verbose $line if ![string match $line "S0130000746D706469722F636F70792E7372656397\r"] { - fail "objcopy -O srec (bad header)" + send_log "bad header\n" + fail "objcopy -O srec" } else { while {[gets $file line] != -1 \ && [regexp "^S\[123\]\[0-9a-fA-F\]+\r$" $line]} { @@ -99,16 +100,19 @@ if ![string match "" $got] then { send_log "$line\n" verbose $line if ![regexp "^S\[789\]\[0-9a-fA-F\]+\r$" $line] then { - fail "objcopy -O srec (bad trailer)" + send_log "bad trailer\n" + fail "objcopy -O srec" } else { if {[gets $file line] != -1} then { + send_log "garbage at end\n" send_log "$line\n" verbose $line - fail "objcopy -O srec (garbage at end)" + fail "objcopy -O srec" } else { set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f tmpdir/copy.srec"] if ![regexp "file format srec" $got] then { - fail "objcopy -O srec (objdump failed)" + send_log "objdump failed\n" + fail "objcopy -O srec" } else { pass "objcopy -O srec" } @@ -138,7 +142,8 @@ if ![regexp "start address (\[0-9a-fA-FxX\]+)" $got all origstart] then { fail "objcopy --set-start" } else { if {$srecstart != 0x7654} then { - fail "objcopy --set-start ($srecstart != 0x7654)" + send_log "$srecstart != 0x7654\n" + fail "objcopy --set-start" } else { pass "objcopy --set-start" } @@ -154,7 +159,8 @@ if ![regexp "start address (\[0-9a-fA-FxX\]+)" $got all origstart] then { fail "objcopy --adjust-start" } else { if {$srecstart != $origstart + 0x123} then { - fail "objcopy --adjust-start ($srecstart != $origstart + 0x123)" + send_log "$srecstart != $origstart + 0x123\n" + fail "objcopy --adjust-start" } else { pass "objcopy --adjust-start" } @@ -163,7 +169,7 @@ if ![regexp "start address (\[0-9a-fA-FxX\]+)" $got all origstart] then { } # Test adjusting the overall VMA, and adjusting the VMA of a -# particular section. We again only test this when # generating S +# particular section. We again only test this when generating S # records. set low "" @@ -171,14 +177,17 @@ set lowname "" set headers [binutils_run $OBJDUMP "$OBJDUMPFLAGS -h tmpdir/bintest.o"] -set headers_regexp "SECTION\[ 0-9\]+\\\[(\[^\]\]*)\\\]\[^\n\r\]*size\[ \]*(\[0-9a-fA-F\]+)\[ \]*vma\[ \]*(\[0-9a-fA-F\]+)(.*)" +set headers_regexp "SECTION\[ 0-9\]+\\\[(\[^\]\]*)\\\]\[^\n\r\]*size\[ \]*(\[0-9a-fA-F\]+)\[0-9a-zA-Z \]*lma\[ \]*(\[0-9a-fA-F\]+)(.*)" set got $headers while {[regexp $headers_regexp $got all name size vma rest]} { set vma 0x$vma - if {$low == "" || $vma < $low} then { - set low $vma - set lowname $name + set size 0x$size + if {$size != 0} { + if {$low == "" || $vma < $low} { + set low $vma + set lowname $name + } } set got $rest } @@ -197,10 +206,12 @@ if {$low == "" || $origstart == ""} then { } else { set vma 0x$vma if {$vma != $low + 0x123} then { - fail "objcopy --adjust-vma ($vma != $low + 0x123)" + send_log "$vma != $low + 0x123\n" + fail "objcopy --adjust-vma" } else { if {$start != $origstart + 0x123} then { - fail "objcopy --adjust-vma ($start != $origstart + 0x123)" + send_log "$start != $origstart + 0x123\n" + fail "objcopy --adjust-vma" } else { pass "objcopy --adjust-vma" } @@ -229,7 +240,8 @@ if {$low == "" || $origstart == ""} then { } else { set vma 0x$vma if {$vma != $low + 4} then { - fail "objcopy --adjust-section-vma + ($vma != $low + 4)" + send_log "$vma != $low + 4\n" + fail "objcopy --adjust-section-vma +" } else { pass "objcopy --adjust-section-vma +" } @@ -248,7 +260,8 @@ if {$low == "" || $origstart == ""} then { } else { set vma 0x$vma if {$vma != $low + 4} then { - fail "objcopy --adjust-section-vma = ($vma != $low + 4)" + send_log "$vma != $low + 4\n" + fail "objcopy --adjust-section-vma =" } else { pass "objcopy --adjust-section-vma =" } -- 2.30.2