Commit 3abf629a authored by Keith Owens's avatar Keith Owens Committed by Linus Torvalds

[PATCH] fix module kallsym lookup breakage

Anton Blanchard wrote:
>Your recent patch looks to break module kallsyms lookups....
>It looks like if CONFIG_KALLSYMS_ALL is set then we never look up module
>addresses.

Separate lookups for kernel and modules when CONFIG_KALLSYMS_ALL=y.
Signed-off-by: default avatarKeith Owens <kaos@ocs.com.au>
Acked-by: default avatarChris Wedgwood <cw@f00f.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 66e586c6
......@@ -53,6 +53,13 @@ static inline int is_kernel_text(unsigned long addr)
return in_gate_area_no_task(addr);
}
static inline int is_kernel(unsigned long addr)
{
if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end)
return 1;
return in_gate_area_no_task(addr);
}
/* expand a compressed symbol data into the resulting uncompressed string,
given the offset to where the symbol is in the compressed stream */
static unsigned int kallsyms_expand_symbol(unsigned int off, char *result)
......@@ -153,7 +160,8 @@ const char *kallsyms_lookup(unsigned long addr,
namebuf[KSYM_NAME_LEN] = 0;
namebuf[0] = 0;
if (all_var || is_kernel_text(addr) || is_kernel_inittext(addr)) {
if ((all_var && is_kernel(addr)) ||
(!all_var && (is_kernel_text(addr) || is_kernel_inittext(addr)))) {
unsigned long symbol_end=0;
/* do a binary search on the sorted kallsyms_addresses array */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment