bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gprof can't find .text symbols on elf32-bigmips files


From: Uros Prestor
Subject: gprof can't find .text symbols on elf32-bigmips files
Date: Thu, 06 Dec 2001 18:21:24 -0800

Hello,

I am using gprof out of binutils-2.11.2 to process ELF files generated
by a NetBSD cross-compiler (cross-gcc is egcs-2.91.60, cross-ld 2.9.1).
Gprof can't seem to find a large number of .text symbols.  It turns out
that binutils elf32-bigmips backend reports text addresses as absolute
(Aa) instead of text (Tt), which causes gprof symbol filtering to
discard most of them.

The following patch maps absolute symbols into text addresses to work
around this problem.  I don't know whether this is the correct thing to
do.  I'd think convincing elf32-mips backend to not report .text
addresses as absolute values would be the right way of solving it, but I
don't know enough about the backend to attempt this myself.  It could
also be that newer versions of binutils do not suffer from this symptom
-- I could not verify the behavior with a newer toolchain.

Thanks,
Uros

P.S.
Keep me on the cc: list as I am not subscribed to bug-binutils.

--
Uros Prestor
address@hidden


Index: gprof/corefile.c
===================================================================
RCS file: /sw/CVS/repos/gnucvs/binutils/gprof/corefile.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 corefile.c
--- gprof/corefile.c    2001/06/27 05:02:10     1.1.1.3
+++ gprof/corefile.c    2001/10/06 00:02:14
@@ -298,6 +298,11 @@
   bfd_get_symbol_info (core_bfd, sym, &syminfo);
   i = syminfo.type;
 
+  /* XXX for some reason mips-elf reports text symbols as absolute values.
+   * Map absolute types into text and let them be filtered out later */
+  if (i == 'A' || i == 'a')
+      i += 'T' - 'A';
+
   if (i == 'T')
     return i;                  /* It's a global symbol.  */
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]