aboutsummaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-02 12:06:23 +0100
committerSam James <sam@gentoo.org>2023-08-02 12:06:23 +0100
commitb5c37946cce4b41af0436529b139fa3d23e61f73 (patch)
tree02129ebadb74e7d3f2430cf8221799ce186600e3 /gprof
parent675b9d612cc59446e84e2c6d89b45500cb603a8d (diff)
downloadfsf-binutils-gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.zip
fsf-binutils-gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.tar.gz
fsf-binutils-gdb-b5c37946cce4b41af0436529b139fa3d23e61f73.tar.bz2
Revert "2.41 Release sources"
This reverts commit 675b9d612cc59446e84e2c6d89b45500cb603a8d. See https://sourceware.org/pipermail/binutils/2023-August/128761.html.
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog5
-rw-r--r--gprof/aarch64.c3
-rw-r--r--gprof/alpha.c4
-rw-r--r--gprof/cg_arcs.c7
-rwxr-xr-xgprof/configure20
-rw-r--r--gprof/i386.c3
-rw-r--r--gprof/mips.c2
-rw-r--r--gprof/po/es.po84
-rw-r--r--gprof/po/gprof.pot9
-rw-r--r--gprof/sparc.c4
-rw-r--r--gprof/vax.c24
11 files changed, 94 insertions, 71 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 5500fd1..a57b89c 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,8 +1,3 @@
-2023-07-30 Nick Clifton <nickc@redhat.com>
-
- This is the 2.41 release.
- * configure: Regenerate.
-
2023-07-03 Nick Clifton <nickc@redhat.com>
* configure: Regenerate.
diff --git a/gprof/aarch64.c b/gprof/aarch64.c
index 68febf9..3ab6067 100644
--- a/gprof/aarch64.c
+++ b/gprof/aarch64.c
@@ -54,7 +54,8 @@ aarch64_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n",
parent->name, (unsigned long) p_lowpc,
(unsigned long) p_highpc));
-
+ p_lowpc = (p_lowpc + 3) & ~3;
+ p_highpc &= ~3;
for (pc = p_lowpc; pc < p_highpc; pc += 4)
{
diff --git a/gprof/alpha.c b/gprof/alpha.c
index d84cdf0..df714be 100644
--- a/gprof/alpha.c
+++ b/gprof/alpha.c
@@ -107,7 +107,9 @@ alpha_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
DBG (CALLDEBUG, printf (_("[find_call] %s: 0x%lx to 0x%lx\n"),
parent->name, (unsigned long) p_lowpc,
(unsigned long) p_highpc));
- for (pc = (p_lowpc + 3) & ~(bfd_vma) 3; pc < p_highpc; pc += 4)
+ p_lowpc = (p_lowpc + 3) & ~3;
+ p_highpc &= ~3;
+ for (pc = p_lowpc; pc < p_highpc; pc += 4)
{
insn = bfd_get_32 (core_bfd, ((unsigned char *) core_text_space
+ pc - core_text_sect->vma));
diff --git a/gprof/cg_arcs.c b/gprof/cg_arcs.c
index e76c2cb..cfffb09 100644
--- a/gprof/cg_arcs.c
+++ b/gprof/cg_arcs.c
@@ -37,6 +37,7 @@
#include "cg_print.h"
#include "utils.h"
#include "sym_ids.h"
+#include "corefile.h"
static int cmp_topo (const void *, const void *);
static void propagate_time (Sym *);
@@ -622,7 +623,11 @@ cg_assemble (void)
parent->cg.cyc.num = 0;
parent->cg.cyc.head = parent;
parent->cg.cyc.next = 0;
- if (ignore_direct_calls)
+ if (ignore_direct_calls
+ && parent->addr >= core_text_sect->vma
+ && parent->addr < core_text_sect->vma + core_text_sect->size
+ && (parent + 1)->addr >= core_text_sect->vma
+ && (parent + 1)->addr <= core_text_sect->vma + core_text_sect->size)
find_call (parent, parent->addr, (parent + 1)->addr);
}
diff --git a/gprof/configure b/gprof/configure
index 6760f6f..4bf25c3 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gprof 2.41.
+# Generated by GNU Autoconf 2.69 for gprof 2.41.50.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gprof'
PACKAGE_TARNAME='gprof'
-PACKAGE_VERSION='2.41'
-PACKAGE_STRING='gprof 2.41'
+PACKAGE_VERSION='2.41.50'
+PACKAGE_STRING='gprof 2.41.50'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1338,7 +1338,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gprof 2.41 to adapt to many kinds of systems.
+\`configure' configures gprof 2.41.50 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1409,7 +1409,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gprof 2.41:";;
+ short | recursive ) echo "Configuration of gprof 2.41.50:";;
esac
cat <<\_ACEOF
@@ -1520,7 +1520,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gprof configure 2.41
+gprof configure 2.41.50
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1885,7 +1885,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gprof $as_me 2.41, which was
+It was created by gprof $as_me 2.41.50, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2864,7 +2864,7 @@ fi
# Define the identity of the package.
PACKAGE='gprof'
- VERSION='2.41'
+ VERSION='2.41.50'
cat >>confdefs.h <<_ACEOF
@@ -12572,7 +12572,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gprof $as_me 2.41, which was
+This file was extended by gprof $as_me 2.41.50, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12638,7 +12638,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gprof config.status 2.41
+gprof config.status 2.41.50
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/gprof/i386.c b/gprof/i386.c
index bdf8bd1..62f6f96 100644
--- a/gprof/i386.c
+++ b/gprof/i386.c
@@ -57,6 +57,9 @@ i386_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
parent->name, (unsigned long) p_lowpc,
(unsigned long) p_highpc));
+ if (p_highpc < 5)
+ return;
+ p_highpc -= 5;
for (pc = p_lowpc; pc < p_highpc; ++pc)
{
instructp = (unsigned char *) core_text_space + pc - core_text_sect->vma;
diff --git a/gprof/mips.c b/gprof/mips.c
index e198a6f..0ccd17d 100644
--- a/gprof/mips.c
+++ b/gprof/mips.c
@@ -59,6 +59,8 @@ mips_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
DBG (CALLDEBUG, printf (_("[find_call] %s: 0x%lx to 0x%lx\n"),
parent->name, (unsigned long) p_lowpc,
(unsigned long) p_highpc));
+ p_lowpc = (p_lowpc + 3) & ~3;
+ p_highpc &= ~3;
for (pc = p_lowpc; pc < p_highpc; pc += 4)
{
op = bfd_get_32 (core_bfd, ((unsigned char *)core_text_space
diff --git a/gprof/po/es.po b/gprof/po/es.po
index fa3f5e6..bce3eac 100644
--- a/gprof/po/es.po
+++ b/gprof/po/es.po
@@ -2,14 +2,14 @@
# Copyright (C) 2002 - 2020 Free Software Foundation, Inc.
# This file is distributed under the same license as the binutils package.
# Cristian Othón Martínez Vera <cfuga@cfuga.mx>, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012.
-# Antonio Ceballos Roa <aceballos@gmail.com>, 2020
+# Antonio Ceballos Roa <aceballos@gmail.com>, 2020, 2023
#
msgid ""
msgstr ""
-"Project-Id-Version: gprof 2.33.90\n"
-"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n"
-"POT-Creation-Date: 2020-01-18 14:04+0000\n"
-"PO-Revision-Date: 2020-05-15 09:01+0200\n"
+"Project-Id-Version: gprof 2.39.90\n"
+"Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n"
+"POT-Creation-Date: 2022-12-31 12:22+0000\n"
+"PO-Revision-Date: 2023-07-30 18:19+0200\n"
"Last-Translator: Antonio Ceballos Roa <aceballos@gmail.com>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
"Language: es\n"
@@ -240,7 +240,7 @@ msgstr "<ciclo %d>"
msgid "%s: unable to parse mapping file %s.\n"
msgstr "%s: no se puede analizar el fichero de asociaciones %s.\n"
-#: corefile.c:89 corefile.c:523
+#: corefile.c:89 corefile.c:524
#, c-format
msgid "%s: could not open %s.\n"
msgstr "%s: no se puede abrir %s.\n"
@@ -270,107 +270,107 @@ msgstr "%s: no se puede hacer -c\n"
msgid "%s: -c not supported on architecture %s\n"
msgstr "%s: -c no se admite en la arquitectura %s\n"
-#: corefile.c:532 corefile.c:637
+#: corefile.c:533 corefile.c:640
#, c-format
msgid "%s: file `%s' has no symbols\n"
msgstr "%s: el fichero `%s' no tiene símbolos\n"
-#: corefile.c:537
+#: corefile.c:538
#, c-format
msgid "%s: file `%s' has too many symbols\n"
msgstr "%s: el fichero `%s' tiene demasiados símbolos\n"
-#: corefile.c:904
+#: corefile.c:907
#, c-format
msgid "%s: somebody miscounted: ltab.len=%d instead of %ld\n"
msgstr "%s: alguien contó mal: ltab.len=%d en lugar de %ld\n"
-#: gmon_io.c:83
+#: gmon_io.c:81
#, c-format
msgid "%s: address size has unexpected value of %u\n"
msgstr "%s: el tamaño de la dirección tiene un valor inesperado de %u\n"
-#: gmon_io.c:318 gmon_io.c:414
+#: gmon_io.c:298 gmon_io.c:394
#, c-format
msgid "%s: file too short to be a gmon file\n"
msgstr "%s: el fichero es muy corto para ser un fichero gmon\n"
-#: gmon_io.c:328 gmon_io.c:457
+#: gmon_io.c:308 gmon_io.c:437
#, c-format
msgid "%s: file `%s' has bad magic cookie\n"
msgstr "%s: el fichero `%s' tiene un cookie mágico equivocado\n"
-#: gmon_io.c:339
+#: gmon_io.c:319
#, c-format
msgid "%s: file `%s' has unsupported version %d\n"
msgstr "%s: el fichero `%s' tiene la versión %d no admitida\n"
-#: gmon_io.c:369
+#: gmon_io.c:349
#, c-format
msgid "%s: %s: found bad tag %d (file corrupted?)\n"
msgstr "%s: %s: encontrada etiqueta %d equivocada (¿fichero corrupto?)\n"
-#: gmon_io.c:436
+#: gmon_io.c:416
#, c-format
msgid "%s: profiling rate incompatible with first gmon file\n"
msgstr "%s: tipo de perfilado incompatible con el primer fichero gmon\n"
-#: gmon_io.c:487
+#: gmon_io.c:467
#, c-format
msgid "%s: incompatible with first gmon file\n"
msgstr "%s: incompatible con el primer fichero gmon\n"
-#: gmon_io.c:517
+#: gmon_io.c:497
#, c-format
msgid "%s: file '%s' does not appear to be in gmon.out format\n"
msgstr "%s: el fichero '%s' no parece estar en el formato gmon.out\n"
-#: gmon_io.c:530
+#: gmon_io.c:510
#, c-format
msgid "%s: unexpected EOF after reading %d/%d bins\n"
msgstr "%s: EOF inesperado tras leer %d/%d binarios\n"
-#: gmon_io.c:562
+#: gmon_io.c:542
#, c-format
msgid "time is in ticks, not seconds\n"
msgstr "el tiempo está en tics, no en segundos\n"
-#: gmon_io.c:568 gmon_io.c:748
+#: gmon_io.c:548 gmon_io.c:728
#, c-format
msgid "%s: don't know how to deal with file format %d\n"
msgstr "%s: se desconoce cómo tratar el formato de fichero %d\n"
-#: gmon_io.c:578
+#: gmon_io.c:558
#, c-format
msgid "File `%s' (version %d) contains:\n"
msgstr "El fichero `%s' (versión %d) contiene:\n"
-#: gmon_io.c:581
+#: gmon_io.c:561
#, c-format
msgid "\t%d histogram record\n"
msgstr "\t%d registro de histograma\n"
-#: gmon_io.c:582
+#: gmon_io.c:562
#, c-format
msgid "\t%d histogram records\n"
msgstr "\t%d registros de histogramas\n"
-#: gmon_io.c:584
+#: gmon_io.c:564
#, c-format
msgid "\t%d call-graph record\n"
msgstr "\t%d registro de gráfico de llamadas\n"
-#: gmon_io.c:585
+#: gmon_io.c:565
#, c-format
msgid "\t%d call-graph records\n"
msgstr "\t%d registros de gráficos de llamadas\n"
-#: gmon_io.c:587
+#: gmon_io.c:567
#, c-format
msgid "\t%d basic-block count record\n"
msgstr "\t%d registro de cuenta de bloques básicos\n"
-#: gmon_io.c:588
+#: gmon_io.c:568
#, c-format
msgid "\t%d basic-block count records\n"
msgstr "\t%d registros de cuentas de bloques básicos\n"
@@ -378,7 +378,7 @@ msgstr "\t%d registros de cuentas de bloques básicos\n"
#: gprof.c:162
#, c-format
msgid ""
-"Usage: %s [-[abcDhilLrsTvwxyz]] [-[ACeEfFJnNOpPqQRStZ][name]] [-I dirs]\n"
+"Usage: %s [-[abcDhilLrsTvwxyz]] [-[ABCeEfFJnNOpPqQRStZ][name]] [-I dirs]\n"
"\t[-d[num]] [-k from/to] [-m min-count] [-t table-length]\n"
"\t[--[no-]annotated-source[=name]] [--[no-]exec-counts[=name]]\n"
"\t[--[no-]flat-profile[=name]] [--[no-]graph[=name]]\n"
@@ -392,7 +392,7 @@ msgid ""
"\t[--demangle[=STYLE]] [--no-demangle] [--external-symbol-table=name] [@FILE]\n"
"\t[image-file] [profile-file...]\n"
msgstr ""
-"Modo de empleo: %s [-[abcDhilLrsTvwxyz]] [-[ACeEfFJnNOpPqQRStZ][nombre]] [-I dirs]\n"
+"Modo de empleo: %s [-[abcDhilLrsTvwxyz]] [-[ABCeEfFJnNOpPqQRStZ][nombre]] [-I dirs]\n"
"\t[-d[num]] [-k origen/destino] [-m cuenta-min] [-t longitud-tabla]\n"
"\t[--[no-]annotated-source[=nombre]] [--[no-]exec-counts[=nombre]]\n"
"\t[--[no-]flat-profile[=nombre]] [--[no-]graph[=nombre]]\n"
@@ -411,53 +411,53 @@ msgstr ""
msgid "Report bugs to %s\n"
msgstr "Comunicar defectos a %s\n"
-#: gprof.c:254
+#: gprof.c:252
#, c-format
msgid "%s: debugging not supported; -d ignored\n"
msgstr "%s: no se admite la depuración; se descarta -d\n"
-#: gprof.c:340
+#: gprof.c:338
#, c-format
msgid "%s: unknown file format %s\n"
msgstr "%s: formato de fichero %s desconocido\n"
#. This output is intended to follow the GNU standards document.
-#: gprof.c:428
+#: gprof.c:426
#, c-format
msgid "GNU gprof %s\n"
msgstr "GNU gprof %s\n"
-#: gprof.c:429
+#: gprof.c:427
#, c-format
msgid "Based on BSD gprof, copyright 1983 Regents of the University of California.\n"
msgstr "Basado en gprof de BSD, © 1983 Regents of the University of California.\n"
-#: gprof.c:430
+#: gprof.c:428
#, c-format
msgid "This program is free software. This program has absolutely no warranty.\n"
msgstr "Este programa es software libre. Este programa no tiene ninguna garantía en absoluto.\n"
-#: gprof.c:471
+#: gprof.c:469
#, c-format
msgid "%s: unknown demangling style `%s'\n"
msgstr "%s: estilo de desenredo desconocido `%s'\n"
-#: gprof.c:494
+#: gprof.c:492
#, c-format
msgid "%s: Only one of --function-ordering and --file-ordering may be specified.\n"
msgstr "%s: Solo puede especificarse una de las opciones --function-ordering y --file-ordering.\n"
-#: gprof.c:546
+#: gprof.c:544
#, c-format
msgid "%s: sorry, file format `prof' is not yet supported\n"
msgstr "%s: disculpe, el formato de fichero `prof' aún no está admitido\n"
-#: gprof.c:600
+#: gprof.c:598
#, c-format
msgid "%s: gmon.out file is missing histogram\n"
msgstr "%s: falta el histograma en el fichero gmon.out\n"
-#: gprof.c:607
+#: gprof.c:605
#, c-format
msgid "%s: gmon.out file is missing call-graph data\n"
msgstr "%s: faltan los datos del gráfico de llamadas en el fichero gmon.out\n"
@@ -584,17 +584,17 @@ msgstr "[find_call] 0x%lx: jal"
msgid "[find_call] 0x%lx: jalr\n"
msgstr "[find_call] 0x%lx: jalr\n"
-#: source.c:162
+#: source.c:166
#, c-format
msgid "%s: could not locate `%s'\n"
msgstr "%s: no se puede encontrar `%s'\n"
-#: source.c:237
+#: source.c:244
#, c-format
msgid "*** File %s:\n"
msgstr "*** Fichero %s:\n"
-#: utils.c:106
+#: utils.c:105
#, c-format
msgid " <cycle %d>"
msgstr " <ciclo %d>"
diff --git a/gprof/po/gprof.pot b/gprof/po/gprof.pot
index c87e9d6..c9f538a 100644
--- a/gprof/po/gprof.pot
+++ b/gprof/po/gprof.pot
@@ -8,10 +8,11 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n"
-"POT-Creation-Date: 2023-07-03 11:33+0100\n"
+"POT-Creation-Date: 2022-07-08 11:14+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -245,7 +246,7 @@ msgstr ""
msgid "%s: -c not supported on architecture %s\n"
msgstr ""
-#: corefile.c:533 corefile.c:640
+#: corefile.c:533 corefile.c:638
#, c-format
msgid "%s: file `%s' has no symbols\n"
msgstr ""
@@ -255,7 +256,7 @@ msgstr ""
msgid "%s: file `%s' has too many symbols\n"
msgstr ""
-#: corefile.c:907
+#: corefile.c:905
#, c-format
msgid "%s: somebody miscounted: ltab.len=%d instead of %ld\n"
msgstr ""
@@ -353,7 +354,7 @@ msgstr ""
#: gprof.c:162
#, c-format
msgid ""
-"Usage: %s [-[abcDhilLrsTvwxyz]] [-[ABCeEfFJnNOpPqQRStZ][name]] [-I dirs]\n"
+"Usage: %s [-[abcDhilLrsTvwxyz]] [-[ACeEfFJnNOpPqQRStZ][name]] [-I dirs]\n"
"\t[-d[num]] [-k from/to] [-m min-count] [-t table-length]\n"
"\t[--[no-]annotated-source[=name]] [--[no-]exec-counts[=name]]\n"
"\t[--[no-]flat-profile[=name]] [--[no-]graph[=name]]\n"
diff --git a/gprof/sparc.c b/gprof/sparc.c
index 44724c4..019e58b 100644
--- a/gprof/sparc.c
+++ b/gprof/sparc.c
@@ -51,7 +51,9 @@ sparc_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n",
parent->name, (unsigned long) p_lowpc,
(unsigned long) p_highpc));
- for (pc = (p_lowpc + 3) & ~(bfd_vma) 3; pc < p_highpc; pc += 4)
+ p_lowpc = (p_lowpc + 3) & ~3;
+ p_highpc &= ~3;
+ for (pc = p_lowpc; pc < p_highpc; pc += 4)
{
insn = bfd_get_32 (core_bfd, ((unsigned char *) core_text_space
+ pc - core_text_sect->vma));
diff --git a/gprof/vax.c b/gprof/vax.c
index 9294235..fafe2b1 100644
--- a/gprof/vax.c
+++ b/gprof/vax.c
@@ -252,6 +252,8 @@ vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
(unsigned long) p_highpc));
for (pc = p_lowpc; pc < p_highpc; pc += length)
{
+ unsigned char *operand;
+
length = 1;
instructp = ((unsigned char *) core_text_space
+ pc - core_text_sect->vma);
@@ -263,7 +265,10 @@ vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
*/
DBG (CALLDEBUG,
printf ("[findcall]\t0x%lx:calls", (unsigned long) pc));
- firstmode = vax_operandmode (instructp + length);
+ if (pc - core_text_sect->vma + length >= core_text_sect->size)
+ goto botched;
+ operand = instructp + length;
+ firstmode = vax_operandmode (operand);
switch (firstmode)
{
case literal:
@@ -272,8 +277,11 @@ vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
default:
goto botched;
}
- length += vax_operandlength (instructp + length);
- mode = vax_operandmode (instructp + length);
+ length += vax_operandlength (operand);
+ if (pc - core_text_sect->vma + length >= core_text_sect->size)
+ goto botched;
+ operand = instructp + length;
+ mode = vax_operandmode (operand);
DBG (CALLDEBUG,
printf ("\tfirst operand is %s", vax_operandname (firstmode));
printf ("\tsecond operand is %s\n", vax_operandname (mode)));
@@ -294,8 +302,10 @@ vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
* [are there others that we miss?,
* e.g. arrays of pointers to functions???]
*/
+ length += vax_operandlength (operand);
+ if (pc - core_text_sect->vma + length > core_text_sect->size)
+ goto botched;
arc_add (parent, &indirectchild, (unsigned long) 0);
- length += vax_operandlength (instructp + length);
continue;
case byterel:
case wordrel:
@@ -305,7 +315,10 @@ vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
* check that this is the address of
* a function.
*/
- destpc = pc + vax_offset (instructp + length);
+ length += vax_operandlength (operand);
+ if (pc - core_text_sect->vma + length > core_text_sect->size)
+ goto botched;
+ destpc = pc + vax_offset (operand);
if (hist_check_address (destpc))
{
child = sym_lookup (&symtab, destpc);
@@ -324,7 +337,6 @@ vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
* a hit
*/
arc_add (parent, child, (unsigned long) 0);
- length += vax_operandlength (instructp + length);
continue;
}
}