summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgber <gber@FreeBSD.org>2012-05-25 06:48:42 +0000
committergber <gber@FreeBSD.org>2012-05-25 06:48:42 +0000
commitcf4496cb429a5d911522e9fcd9554a55a8968775 (patch)
tree9f280c8ed5bdfdddfffde4f2a6c072ea4b700f76
parent0413b090c36a77e50e7252af0a74230ef368bb3a (diff)
downloadFreeBSD-src-cf4496cb429a5d911522e9fcd9554a55a8968775.zip
FreeBSD-src-cf4496cb429a5d911522e9fcd9554a55a8968775.tar.gz
Fix resolving symbol names on ARM.
On ARM, binutils are adding '$a' symbols in the symbol table for every function (in addition to normal symbol). When gprof(1) looks up symbol name, it often reads '$a' instead of proper function name, because it find it first. With this fix, when read symbol name begins with '$' and previous symbol has the same address, it will use previous symbol name (which is proper function name). Obtained from: Semihalf
-rw-r--r--usr.bin/gprof/lookup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/gprof/lookup.c b/usr.bin/gprof/lookup.c
index 0f3b763..2561360 100644
--- a/usr.bin/gprof/lookup.c
+++ b/usr.bin/gprof/lookup.c
@@ -66,6 +66,12 @@ nllookup( address )
printf( "[nllookup] %d (%d) probes\n" , probes , nname-1 );
}
# endif /* DEBUG */
+#if defined(__arm__)
+ if (nl[middle].name[0] == '$' &&
+ nl[middle-1].value == nl[middle].value)
+ middle--;
+#endif
+
return &nl[ middle ];
}
if ( nl[ middle ].value > address ) {
OpenPOWER on IntegriCloud