PR 12468, Missing functions and call counts

Alan Modra amodra@gmail.com
Sun Feb 6 23:45:00 GMT 2011


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



More information about the Binutils mailing list