summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorckuethe <ckuethe@openbsd.org>2007-01-09 15:13:37 +0000
committerckuethe <ckuethe@openbsd.org>2007-01-09 15:13:37 +0000
commitdb13cdc66141a91c3f88c33dc9cb1051411bc7f6 (patch)
treea93c2aeb30755ea21e27b7a6f670aa542fe38116
parenttypo (diff)
downloadwireguard-openbsd-db13cdc66141a91c3f88c33dc9cb1051411bc7f6.tar.xz
wireguard-openbsd-db13cdc66141a91c3f88c33dc9cb1051411bc7f6.zip
Ignore "mapping symbols" like $a and $t. They seem to be an ARM-only
feature, used to indicate whether code is ARM or Thumb. Unfortunately they confuse gprof, which outputs call graphs where every other function is named "$a"... not very useful. Rather than enumerating the different symbols, binutils ignores anything beginning with '$', and that is what we will do here. Thanks to Dale Rahn for useful tips along the way. ok miod
-rw-r--r--usr.bin/gprof/elf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/usr.bin/gprof/elf.c b/usr.bin/gprof/elf.c
index 35330312725..5a2381325c9 100644
--- a/usr.bin/gprof/elf.c
+++ b/usr.bin/gprof/elf.c
@@ -144,5 +144,14 @@ wantsym(const Elf_Sym *sym, const char *strtab)
#endif
return 0;
+#ifdef __arm__
+ /* ignore what gas calls "mapping symbols" */
+ {
+ const char *c = strtab + sym->st_name;
+ if (c[0] == '$')
+ return 0;
+ }
+#endif
+
return 1;
}