]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kallsyms: provide symbol sizes in /proc/kallmodsyms
authorNick Alcock <nick.alcock@oracle.com>
Fri, 29 Jun 2012 20:06:28 +0000 (21:06 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 29 Jun 2015 21:40:25 +0000 (22:40 +0100)
commitbab2114faec50ba4d9c7d73210c040cddbe03031
tree0ad22516c2492cbecfc87d5aedc3b5603e7ddfc8
parent786f2381cb3df4c534bf698b90694aa99a3d31da
kallsyms: provide symbol sizes in /proc/kallmodsyms

For modules, we can simply extract these sizes from the module symtab; for core
kernel symbols, we must do subtraction as get_symbol_pos() did: this is now
abstracted into a new get_symbol_size().

Because /proc/kallmodsyms contains *all* symbols, where get_symbol_pos() was
normally only called for a small subset of symbols, this exercises this code
like never before, and has revealed a bug: the size of __per_cpu_end was being
returned as a ludicrously vast value, because the next symbol after
__per_cpu_end is far up the address space, in the kernel proper. Fixing this by
forcing a size of zero for __per_cpu_end is easy enough.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
include/linux/kallsyms.h
include/linux/module.h
kernel/kallsyms.c
kernel/module.c