summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kallsyms.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 4c1ad0a..f359b73 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);
}
OpenPOWER on IntegriCloud