mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 20:23:57 +08:00
MIPS: Ensure ELF appended dtb is relocated
This fixes booting with the combination of CONFIG_RELOCATABLE=y
and CONFIG_MIPS_ELF_APPENDED_DTB=y.
Sections that appear after the relocation table are not relocated
on system boot (except .bss, which has special handling).
With CONFIG_MIPS_ELF_APPENDED_DTB, the dtb is part of the
vmlinux ELF, so it must be relocated together with everything else.
Fixes: 069fd76627
("MIPS: Reserve space for relocation table")
Signed-off-by: Yasha Cherikovsky <yasha.che3@gmail.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # v4.7+
This commit is contained in:
parent
5f5f67da97
commit
3f0a53bc64
@ -140,6 +140,13 @@ SECTIONS
|
|||||||
PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
|
||||||
|
.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
|
||||||
|
*(.appended_dtb)
|
||||||
|
KEEP(*(.appended_dtb))
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_RELOCATABLE
|
#ifdef CONFIG_RELOCATABLE
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
|
||||||
@ -164,11 +171,6 @@ SECTIONS
|
|||||||
__appended_dtb = .;
|
__appended_dtb = .;
|
||||||
/* leave space for appended DTB */
|
/* leave space for appended DTB */
|
||||||
. += 0x100000;
|
. += 0x100000;
|
||||||
#elif defined(CONFIG_MIPS_ELF_APPENDED_DTB)
|
|
||||||
.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
|
|
||||||
*(.appended_dtb)
|
|
||||||
KEEP(*(.appended_dtb))
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Align to 64K in attempt to eliminate holes before the
|
* Align to 64K in attempt to eliminate holes before the
|
||||||
|
Loading…
Reference in New Issue
Block a user