diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-03 16:03:51 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-03 16:03:51 -0800 |
commit | 87b049b5ebcd509ec656492c469846809c61f67e (patch) | |
tree | f60d65f8d30c6892eeec54baa3a95d2d3010dac8 /kernel | |
parent | 5c4ac43f344a226ed1a60ef8b7482cbdb09c1c9f (diff) | |
parent | 3a28b9c6f955aa5ba04c4c634e8ce9e8d1a2b019 (diff) | |
download | history-87b049b5ebcd509ec656492c469846809c61f67e.tar.gz |
Merge bk://linux-sam.bkbits.net/kbuild
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kallsyms.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 8f3c6c1d1ce7a6..8db13f565ed97f 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -18,6 +18,13 @@ #include <linux/fs.h> #include <linux/err.h> #include <linux/proc_fs.h> +#include <linux/mm.h> + +#ifdef CONFIG_KALLSYMS_ALL +#define all_var 1 +#else +#define all_var 0 +#endif /* These will be re-linked against their real values during the second link stage */ extern unsigned long kallsyms_addresses[] __attribute__((weak)); @@ -30,7 +37,7 @@ extern u16 kallsyms_token_index[] __attribute__((weak)); extern unsigned long kallsyms_markers[] __attribute__((weak)); /* Defined by the linker script. */ -extern char _stext[], _etext[], _sinittext[], _einittext[]; +extern char _stext[], _etext[], _sinittext[], _einittext[], _end[]; static inline int is_kernel_inittext(unsigned long addr) { @@ -44,7 +51,7 @@ static inline int is_kernel_text(unsigned long addr) { if (addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) return 1; - return 0; + return in_gate_area_no_task(addr); } /* expand a compressed symbol data into the resulting uncompressed string, @@ -147,7 +154,7 @@ const char *kallsyms_lookup(unsigned long addr, namebuf[KSYM_NAME_LEN] = 0; namebuf[0] = 0; - if (is_kernel_text(addr) || is_kernel_inittext(addr)) { + if (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 */ @@ -181,7 +188,7 @@ const char *kallsyms_lookup(unsigned long addr, if (is_kernel_inittext(addr)) symbol_end = (unsigned long)_einittext; else - symbol_end = (unsigned long)_etext; + symbol_end = all_var ? (unsigned long)_end : (unsigned long)_etext; } *symbolsize = symbol_end - kallsyms_addresses[low]; |