diff options
author | Nick Clifton <nickc@redhat.com> | 2005-03-29 16:13:48 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2005-03-29 16:13:48 +0000 |
commit | ec72cfe589400f06810a571ce4d7f45fb6e19621 (patch) | |
tree | 1e025ae585dad3287f278cc57f80f1ed8179af11 /binutils | |
parent | deb04cdb5ef9b4efa0e57b0e9d02c7800f2ee29a (diff) | |
download | gdb-ec72cfe589400f06810a571ce4d7f45fb6e19621.zip gdb-ec72cfe589400f06810a571ce4d7f45fb6e19621.tar.gz gdb-ec72cfe589400f06810a571ce4d7f45fb6e19621.tar.bz2 |
Add VAX specific disassembler option -Mentry: to specify a function entry
address, and add code to test this new option.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/NEWS | 3 | ||||
-rw-r--r-- | binutils/doc/binutils.texi | 7 | ||||
-rw-r--r-- | binutils/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/vax/entrymask.s | 11 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/vax/objdump.exp | 82 |
6 files changed, 116 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2176716..9ce07ec 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2005-03-21 Jan-Benedict Glaw <jbglaw@lug-owl.de> + + * doc/binutils.texi: Document new VAX disassembler-specific option + -M entry:0xfooba8. + * NEWS: Mention the new option. + 2005-03-29 Anil Paranjpe <anilp1@kpitcummins.com> * MAINTAINERS: Add myself as H8300 maintainer. diff --git a/binutils/NEWS b/binutils/NEWS index e083502..4ab5a08 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -1,5 +1,8 @@ -*- text -*- +* Add "-M entry:<addr>" switch to objdump to specify a function entry address + when disassembling VAX binaries. + * Add "--globalize-symbol <name>" and "--globalize-symbols <filename>" switches to objcopy to convert local symbols into global symbols. diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 0b558fb..4807867 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -1793,6 +1793,13 @@ rather than names, for the selected types of registers. You can list the available values of @var{ABI} and @var{ARCH} using the @option{--help} option. +For VAX, you can specify function entry addresses with @option{-M +entry:0xf00ba}. You can use this multiple times to properly +disassemble VAX binary files that don't contain symbol tables (like +ROM dumps). In these cases, the function entry mask would otherwise +be decoded as VAX instructions, which would probably lead the the rest +of the function being wrongly disassembled. + @item -p @itemx --private-headers Print information that is specific to the object file format. The exact diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index 0902adc..bd490af 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2005-03-29 Jan-Benedict Glaw <jbglaw@lug-owl.de> + + * binutils-all/vax: New directory. + * binutils-all/vax/objdump.exp: New script. Test the -Mentry: + switch added to the VAX disassembler. + * binutils-all/vax/entrymask.s: New assembler source file. + 2005-03-08 Ben Elliston <bje@au.ibm.com> * config/default.exp: Remove send_user call for stray output. diff --git a/binutils/testsuite/binutils-all/vax/entrymask.s b/binutils/testsuite/binutils-all/vax/entrymask.s new file mode 100644 index 0000000..18f9010 --- /dev/null +++ b/binutils/testsuite/binutils-all/vax/entrymask.s @@ -0,0 +1,11 @@ +.text + +.global label1 +label1: + .word 0x0110 + +.global label2 +.type label2,@function +label2: + .word 0x0224 + diff --git a/binutils/testsuite/binutils-all/vax/objdump.exp b/binutils/testsuite/binutils-all/vax/objdump.exp new file mode 100644 index 0000000..dd81633 --- /dev/null +++ b/binutils/testsuite/binutils-all/vax/objdump.exp @@ -0,0 +1,82 @@ +# +# Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2002, 2005 +# 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# +# This file was written by Jan-Benedict Glaw <jbglaw@lug-owl.de>. It's goal +# is to check the VAX-specific support of the -M entry:0xf00 switch, which +# allows to force function entry masks at given addresses. +# + +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 +} + +# +# First run. We expect the function to be a function and the sole label +# not to produce an entry mask. +# +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" +} + +# +# Second run. Now, we force the label as a function, so we expect that +# it also produces an entry mask, as any call'able function should. +# +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" +} + |