mirror of
https://github.com/torvalds/linux.git
synced 2024-12-17 00:21:32 +00:00
97ee351b50
Recent toolchains force the TOC to be 256 byte aligned. We need to enforce this alignment in the zImage linker script, otherwise pointers to our TOC variables (__toc_start) could be incorrect. If the actual start of the TOC and __toc_start don't have the same value we crash early in the zImage wrapper. Cc: stable@vger.kernel.org Suggested-by: Alan Modra <amodra@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
91 lines
1.3 KiB
ArmAsm
91 lines
1.3 KiB
ArmAsm
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
#ifdef CONFIG_PPC64_BOOT_WRAPPER
|
|
OUTPUT_ARCH(powerpc:common64)
|
|
#else
|
|
OUTPUT_ARCH(powerpc:common)
|
|
#endif
|
|
ENTRY(_zimage_start)
|
|
EXTERN(_zimage_start)
|
|
SECTIONS
|
|
{
|
|
.text :
|
|
{
|
|
_start = .;
|
|
*(.text)
|
|
*(.fixup)
|
|
_etext = .;
|
|
}
|
|
. = ALIGN(4096);
|
|
.data :
|
|
{
|
|
*(.rodata*)
|
|
*(.data*)
|
|
*(.sdata*)
|
|
#ifndef CONFIG_PPC64_BOOT_WRAPPER
|
|
*(.got2)
|
|
#endif
|
|
}
|
|
.dynsym : { *(.dynsym) }
|
|
.dynstr : { *(.dynstr) }
|
|
.dynamic :
|
|
{
|
|
__dynamic_start = .;
|
|
*(.dynamic)
|
|
}
|
|
.hash : { *(.hash) }
|
|
.interp : { *(.interp) }
|
|
.rela.dyn :
|
|
{
|
|
#ifdef CONFIG_PPC64_BOOT_WRAPPER
|
|
__rela_dyn_start = .;
|
|
#endif
|
|
*(.rela*)
|
|
}
|
|
|
|
. = ALIGN(8);
|
|
.kernel:dtb :
|
|
{
|
|
_dtb_start = .;
|
|
*(.kernel:dtb)
|
|
_dtb_end = .;
|
|
}
|
|
|
|
. = ALIGN(4096);
|
|
.kernel:vmlinux.strip :
|
|
{
|
|
_vmlinux_start = .;
|
|
*(.kernel:vmlinux.strip)
|
|
_vmlinux_end = .;
|
|
}
|
|
|
|
. = ALIGN(4096);
|
|
.kernel:initrd :
|
|
{
|
|
_initrd_start = .;
|
|
*(.kernel:initrd)
|
|
_initrd_end = .;
|
|
}
|
|
|
|
#ifdef CONFIG_PPC64_BOOT_WRAPPER
|
|
. = ALIGN(256);
|
|
.got :
|
|
{
|
|
__toc_start = .;
|
|
*(.got)
|
|
*(.toc)
|
|
}
|
|
#endif
|
|
|
|
. = ALIGN(4096);
|
|
.bss :
|
|
{
|
|
_edata = .;
|
|
__bss_start = .;
|
|
*(.sbss)
|
|
*(.bss)
|
|
*(COMMON)
|
|
_end = . ;
|
|
}
|
|
}
|