kernel-ark/arch/powerpc/boot/zImage.lds.S
Cédric Le Goater 147c05168f powerpc/boot: Add support for 64bit little endian wrapper
The code is only slightly modified : entry points now use the
FIXUP_ENDIAN trampoline to switch endian order. The 32bit wrapper
is kept for big endian kernels and 64bit is enforced for little
endian kernels with a PPC64_BOOT_WRAPPER config option.

The linker script is generated using the kernel preprocessor flags
to make use of the CONFIG_* definitions and the wrapper script is
modified to take into account the new elf64ppc format.

Finally, the zImage file is compiled as a position independent
executable (-pie) which makes it loadable at any address by the
firmware.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-04-28 17:36:21 +10:00

90 lines
1.2 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
.got :
{
__toc_start = .;
*(.got)
*(.toc)
}
#endif
. = ALIGN(4096);
.bss :
{
_edata = .;
__bss_start = .;
*(.sbss)
*(.bss)
*(COMMON)
_end = . ;
}
}