2005-03-29 16:13:48 +00:00
|
|
|
#
|
2009-09-02 07:25:43 +00:00
|
|
|
# Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2002, 2005, 2007, 2009
|
2005-03-29 16:13:48 +00:00
|
|
|
# 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
|
2007-07-05 16:54:46 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2005-03-29 16:13:48 +00:00
|
|
|
# (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
|
2005-05-08 14:17:41 +00:00
|
|
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-03-29 16:13:48 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
2005-04-04 17:20:29 +00:00
|
|
|
# We check both function entry points. The second one at offset 2 will
|
|
|
|
# show up automatically on ELF targets, but needs to be set on a.out
|
|
|
|
# targets.
|
2005-03-29 16:13:48 +00:00
|
|
|
#
|
2005-04-04 17:20:29 +00:00
|
|
|
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -d -M entry:0x0 -M entry:2 $objfile"]
|
|
|
|
set want1 "\[ \]+0:\[ \]+10 01\[ \]+\\.word 0x0110.\*r8 r4"
|
2005-03-29 16:13:48 +00:00
|
|
|
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"
|
|
|
|
}
|