2014-04-24 07:23:39 +00:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_PPC64_BOOT_WRAPPER
|
|
|
|
OUTPUT_ARCH(powerpc:common64)
|
|
|
|
#else
|
2005-04-16 22:20:36 +00:00
|
|
|
OUTPUT_ARCH(powerpc:common)
|
2014-04-24 07:23:39 +00:00
|
|
|
#endif
|
2005-10-29 00:46:49 +00:00
|
|
|
ENTRY(_zimage_start)
|
[POWERPC] zImage: Cleanup and improve zImage entry point
This patch re-organises the way the zImage wrapper code is entered, to
allow more flexibility on platforms with unusual entry conditions.
After this patch, a platform .o file has two options:
1) It can define a _zimage_start, in which case the platform code gets
control from the very beginning of execution. In this case the
platform code is responsible for relocating the zImage if necessary,
clearing the BSS, performing any platform specific initialization, and
finally calling start() to load and enter the kernel.
2) It can define platform_init(). In this case the generic crt0.S
handles initial entry, and calls platform_init() before calling
start(). The signature of platform_init() is changed, however, to
take up to 5 parameters (in r3..r7) as they come from the platform's
initial loader, instead of a fixed set of parameters based on OF's
usage.
When using the generic crt0.S, the platform .o can optionally
supply a custom stack to use, using the BSS_STACK() macro. If this
is not supplied, the crt0.S will assume that the loader has
supplied a usable stack.
In either case, the platform code communicates information to the
generic code (specifically, a PROM pointer for OF systems, and/or an
initrd image address supplied by the bootloader) via a global
structure "loader_info".
In addition the wrapper script is rearranged to ensure that the
platform .o is always linked first. This means that platforms where
the zImage entry point is at a fixed address or offset, rather than
being encoded in the binary header can be supported using option (1).
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-03-05 03:24:52 +00:00
|
|
|
EXTERN(_zimage_start)
|
2005-04-16 22:20:36 +00:00
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
.text :
|
|
|
|
{
|
2011-04-12 20:38:55 +00:00
|
|
|
_start = .;
|
2005-04-16 22:20:36 +00:00
|
|
|
*(.text)
|
|
|
|
*(.fixup)
|
2011-04-12 20:38:55 +00:00
|
|
|
_etext = .;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
. = ALIGN(4096);
|
|
|
|
.data :
|
|
|
|
{
|
2005-10-29 00:46:44 +00:00
|
|
|
*(.rodata*)
|
|
|
|
*(.data*)
|
|
|
|
*(.sdata*)
|
2014-04-24 07:23:39 +00:00
|
|
|
#ifndef CONFIG_PPC64_BOOT_WRAPPER
|
2005-10-29 00:46:48 +00:00
|
|
|
*(.got2)
|
2014-04-24 07:23:39 +00:00
|
|
|
#endif
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2011-04-12 20:38:55 +00:00
|
|
|
.dynsym : { *(.dynsym) }
|
|
|
|
.dynstr : { *(.dynstr) }
|
|
|
|
.dynamic :
|
|
|
|
{
|
|
|
|
__dynamic_start = .;
|
|
|
|
*(.dynamic)
|
|
|
|
}
|
|
|
|
.hash : { *(.hash) }
|
|
|
|
.interp : { *(.interp) }
|
2014-04-24 07:23:39 +00:00
|
|
|
.rela.dyn :
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_PPC64_BOOT_WRAPPER
|
|
|
|
__rela_dyn_start = .;
|
|
|
|
#endif
|
|
|
|
*(.rela*)
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-11-09 05:00:06 +00:00
|
|
|
. = ALIGN(8);
|
2011-04-12 20:38:55 +00:00
|
|
|
.kernel:dtb :
|
|
|
|
{
|
|
|
|
_dtb_start = .;
|
|
|
|
*(.kernel:dtb)
|
|
|
|
_dtb_end = .;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
. = ALIGN(4096);
|
2011-04-12 20:38:55 +00:00
|
|
|
.kernel:vmlinux.strip :
|
|
|
|
{
|
|
|
|
_vmlinux_start = .;
|
|
|
|
*(.kernel:vmlinux.strip)
|
|
|
|
_vmlinux_end = .;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
. = ALIGN(4096);
|
2011-04-12 20:38:55 +00:00
|
|
|
.kernel:initrd :
|
|
|
|
{
|
|
|
|
_initrd_start = .;
|
|
|
|
*(.kernel:initrd)
|
|
|
|
_initrd_end = .;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2014-04-24 07:23:39 +00:00
|
|
|
#ifdef CONFIG_PPC64_BOOT_WRAPPER
|
|
|
|
.got :
|
|
|
|
{
|
|
|
|
__toc_start = .;
|
|
|
|
*(.got)
|
|
|
|
*(.toc)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
. = ALIGN(4096);
|
|
|
|
.bss :
|
|
|
|
{
|
2011-04-12 20:38:55 +00:00
|
|
|
_edata = .;
|
|
|
|
__bss_start = .;
|
|
|
|
*(.sbss)
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
_end = . ;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|