OK, there's an additional issue in my latest version: the
kallsyms_relative_base value itself is not relocated.
If you have more time to burn on this, could you try the following on
top? (If not, that is also fine, I will look into it myself on Monday)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 5ab13394dfd9..0f43f0751d47 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -137,8 +137,10 @@ static int read_symbol(FILE *in, struct sym_entry *s)
sym++;
/* Ignore most absolute/undefined (?) symbols. */
- if (strcmp(sym, "_text") == 0)
+ if (strcmp(sym, "_text") == 0) {
_text = s->addr;
+ stype = 'T';
+ }
else if (check_symbol_range(sym, s->addr, text_ranges,
ARRAY_SIZE(text_ranges)) == 0)
/* nothing to do */;
@@ -406,7 +408,7 @@ static void write_src(void)
if (base_relative) {
output_label("kallsyms_relative_base");
- printf("\tPTR\t%#llx\n", relative_base);
+ printf("\tPTR\t_text - %#llx\n", _text - relative_base);
printf("\n");
}
Does not help.
For x86? Or none of them?