From: Vivek Goyal Date: Thu, 7 Dec 2006 01:14:10 +0000 (+0100) Subject: [PATCH] relocatable kernel: Fix kallsyms on avr32 after relocatable kernel changes X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=2c22d8baa98a92022acb85b0b7c6f4a60df55f47;p=openwrt%2Fstaging%2Fblogic.git [PATCH] relocatable kernel: Fix kallsyms on avr32 after relocatable kernel changes o On some platforms like avr32, section init comes before .text and not necessarily a symbol's relative position w.r.t _text is positive. In such cases assembler detects the overflow and emits warning. This patch fixes it. Signed-off-by: Vivek Goyal Signed-off-by: Andi Kleen Cc: Andi Kleen Cc: Haavard Skinnemoen Signed-off-by: Andrew Morton --- diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 4c1ad0acbb4b..f359b730c2c5 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -277,8 +277,12 @@ static void write_src(void) output_label("kallsyms_addresses"); for (i = 0; i < table_cnt; i++) { if (toupper(table[i].sym[0]) != 'A') { - printf("\tPTR\t_text + %#llx\n", - table[i].addr - _text); + if (_text <= table[i].addr) + printf("\tPTR\t_text + %#llx\n", + table[i].addr - _text); + else + printf("\tPTR\t_text - %#llx\n", + _text - table[i].addr); } else { printf("\tPTR\t%#llx\n", table[i].addr); }