summaryrefslogtreecommitdiff
path: root/gprof/corefile.c
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2002-07-24 15:25:03 +0000
committerDave Brolley <brolley@redhat.com>2002-07-24 15:25:03 +0000
commite94e3af3e62a8a885338277219787a4e49f2d259 (patch)
treefbb32ac2747074eaad69bad96fe127dc829837f0 /gprof/corefile.c
parent7674c9be58b2dfa4ab007609982b5fb40122ef20 (diff)
downloadbinutils-redhat-e94e3af3e62a8a885338277219787a4e49f2d259.tar.gz
2002-07-24 Dave Brolley <brolley@redhat.com>
* corefile.c (core_create_function_syms): Use the end of the section containing the symbol to compute max_vma.
Diffstat (limited to 'gprof/corefile.c')
-rw-r--r--gprof/corefile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gprof/corefile.c b/gprof/corefile.c
index fdebc88fe6..74e78f5eec 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -542,8 +542,15 @@ core_create_function_syms (cbfd)
if (class == 't')
symtab.limit->is_static = true;
+ /* Keep track of the minimum and maximum vma addresses used by all
+ symbols. When computing the max_vma, use the ending address of the
+ section containing the symbol, if available. */
min_vma = MIN (symtab.limit->addr, min_vma);
- max_vma = MAX (symtab.limit->addr, max_vma);
+ if (core_syms[i]->section)
+ max_vma = MAX (core_syms[i]->section->vma
+ + core_syms[i]->section->_cooked_size - 1, max_vma);
+ else
+ max_vma = MAX (symtab.limit->addr, max_vma);
/* If we see "main" without an initial '_', we assume names
are *not* prefixed by '_'. */