diff options
author | Jinyang He <hejinyang@loongson.cn> | 2021-02-05 11:11:22 +0100 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2021-02-09 10:56:04 +0100 |
commit | 457d2fc54f00b97367a67ef9dadebfd06772d9af (patch) | |
tree | 089bf5f402d42b2d1668a55d0f16ebf5b32a1bf7 /arch/mips | |
parent | MIPS: relocatable: Provide kaslr_offset() to get the kernel offset (diff) | |
download | linux-457d2fc54f00b97367a67ef9dadebfd06772d9af.tar.xz linux-457d2fc54f00b97367a67ef9dadebfd06772d9af.zip |
MIPS: relocatable: Use __kaslr_offset in show_kernel_relocation
The type of the VMLINUX_LOAD_ADDRESS macro is the (unsigned long long)
in 32bits kernel but (unsigned long) in the 64-bit kernel. Although there
is no error here, avoid using it to calculate kaslr_offset.
Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/relocate.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/mips/kernel/relocate.c b/arch/mips/kernel/relocate.c index 95abb9c82f00..e73c4fd74161 100644 --- a/arch/mips/kernel/relocate.c +++ b/arch/mips/kernel/relocate.c @@ -430,13 +430,9 @@ out: */ static void show_kernel_relocation(const char *level) { - unsigned long offset; - - offset = __pa_symbol(_text) - __pa_symbol(VMLINUX_LOAD_ADDRESS); - - if (IS_ENABLED(CONFIG_RELOCATABLE) && offset > 0) { + if (__kaslr_offset > 0) { printk(level); - pr_cont("Kernel relocated by 0x%pK\n", (void *)offset); + pr_cont("Kernel relocated by 0x%pK\n", (void *)__kaslr_offset); pr_cont(" .text @ 0x%pK\n", _text); pr_cont(" .data @ 0x%pK\n", _sdata); pr_cont(" .bss @ 0x%pK\n", __bss_start); |