summaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-02-06 23:38:37 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-02-06 23:38:37 +0000
commit9c426db13a040c18f02d792ad7044855750210d2 (patch)
tree4a570c2d3596615b0e29d03e77fa43cb8c1ddb9d /gprof
parent9c769c42b4795350ba2c3d713c03642dbcf1f049 (diff)
downloadbinutils-redhat-9c426db13a040c18f02d792ad7044855750210d2.tar.gz
PR gprof/12468
* corefile.c (core_create_function_syms): Set is_func for targets that have no BSF_FUNCTION syms.
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog6
-rw-r--r--gprof/corefile.c19
2 files changed, 23 insertions, 2 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 73427a6096..fbf8b90d79 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-07 Alan Modra <amodra@gmail.com>
+
+ PR gprof/12468
+ * corefile.c (core_create_function_syms): Set is_func for targets
+ that have no BSF_FUNCTION syms.
+
2011-01-10 Nick Clifton <nickc@redhat.com>
* po/da.po: Updated Danish translation.
diff --git a/gprof/corefile.c b/gprof/corefile.c
index 6b10d17748..fd4644bfbd 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -1,7 +1,7 @@
/* corefile.c
Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2011 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -573,6 +573,20 @@ core_create_function_syms (void)
int cxxclass;
long i;
struct function_map * found;
+ int core_has_func_syms = 0;
+
+ switch (core_bfd->xvec->flavour)
+ {
+ default:
+ break;
+ case bfd_target_coff_flavour:
+ case bfd_target_ecoff_flavour:
+ case bfd_target_xcoff_flavour:
+ case bfd_target_elf_flavour:
+ case bfd_target_nlm_flavour:
+ case bfd_target_som_flavour:
+ core_has_func_syms = 1;
+ }
/* Pass 1 - determine upper bound on number of function names. */
symtab.len = 0;
@@ -678,7 +692,8 @@ core_create_function_syms (void)
}
}
- symtab.limit->is_func = (core_syms[i]->flags & BSF_FUNCTION) != 0;
+ symtab.limit->is_func = (!core_has_func_syms
+ || (core_syms[i]->flags & BSF_FUNCTION) != 0);
symtab.limit->is_bb_head = TRUE;
if (cxxclass == 't')