Commit aab34ac8582303ef57b792710fc5dd5991477475

Authored by Sam Ravnborg
1 parent 1f5d3a6b65

kbuild: filter away debug symbols from kernel symbols

Andi Kleen <andi@firstfloor.org>
reported that he saw a lot of symbols like this:

0000000000000b24 N DW.aio.h.903a6d92.2
0000000000000bce N DW.task_io_accounting.h.8d8de327.0
0000000000000bec N DW.hrtimer.h.c23659c6.0

in his System.map / kallsyms output.

Simple solution is to skip all debugging
symbols (they are marked 'N').

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Paulo Marques <pmarques@grupopie.com>

Showing 2 changed files with 5 additions and 1 deletions Side-by-side Diff

... ... @@ -108,6 +108,9 @@
108 108 /* exclude also MIPS ELF local symbols ($L123 instead of .L123) */
109 109 else if (str[0] == '$')
110 110 return -1;
  111 + /* exclude debugging symbols */
  112 + else if (stype == 'N')
  113 + return -1;
111 114  
112 115 /* include the type field in the symbol name, so that it gets
113 116 * compressed together */
... ... @@ -32,6 +32,7 @@
32 32 # For System.map filter away:
33 33 # a - local absolute symbols
34 34 # U - undefined global symbols
  35 +# N - debugging symbols
35 36 # w - local weak symbols
36 37  
37 38 # readprofile starts reading symbols when _stext is found, and
... ... @@ -40,5 +41,5 @@
40 41 # so we just ignore them to let readprofile continue to work.
41 42 # (At least sparc64 has __crc_ in the middle).
42 43  
43   -$NM -n $1 | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $2
  44 +$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $2