public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR 12468, Missing functions and call counts
@ 2011-02-06 23:45 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2011-02-06 23:45 UTC (permalink / raw)
  To: binutils

This fixes a regression on aout and other targets, introduced
http://lists.gnu.org/archive/html/bug-binutils/2009-04/msg00028.html

	PR gprof/12468
	* corefile.c (core_create_function_syms): Set is_func for targets
	that have no BSF_FUNCTION syms.

Index: gprof/corefile.c
===================================================================
RCS file: /cvs/src/src/gprof/corefile.c,v
retrieving revision 1.40
diff -u -p -r1.40 corefile.c
--- gprof/corefile.c	16 Jul 2010 14:52:15 -0000	1.40
+++ gprof/corefile.c	6 Feb 2011 22:43:47 -0000
@@ -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')

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-06 23:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-06 23:45 PR 12468, Missing functions and call counts Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).