ar71xx: fix legacy image build error
[openwrt/openwrt.git] / target / linux / generic / patches-4.1 / 205-backtrace_module_info.patch
1 --- a/lib/vsprintf.c
2 +++ b/lib/vsprintf.c
3 @@ -617,8 +617,10 @@ char *symbol_string(char *buf, char *end
4 struct printf_spec spec, const char *fmt)
5 {
6 unsigned long value;
7 -#ifdef CONFIG_KALLSYMS
8 char sym[KSYM_SYMBOL_LEN];
9 +#ifndef CONFIG_KALLSYMS
10 + struct module *mod;
11 + int len;
12 #endif
13
14 if (fmt[1] == 'R')
15 @@ -632,15 +634,15 @@ char *symbol_string(char *buf, char *end
16 sprint_symbol(sym, value);
17 else
18 sprint_symbol_no_offset(sym, value);
19 -
20 - return string(buf, end, sym, spec);
21 #else
22 - spec.field_width = 2 * sizeof(void *);
23 - spec.flags |= SPECIAL | SMALL | ZEROPAD;
24 - spec.base = 16;
25 + len = snprintf(sym, sizeof(sym), "0x%lx", value);
26
27 - return number(buf, end, value, spec);
28 + mod = __module_address(value);
29 + if (mod)
30 + snprintf(sym + len, sizeof(sym) - len, " [%s@%p+0x%x]",
31 + mod->name, mod->module_core, mod->core_size);
32 #endif
33 + return string(buf, end, sym, spec);
34 }
35
36 static noinline_for_stack