2009-03-27 14:25:20 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
|
|
|
|
* Copyright (C) 2008-2009 PetaLogix
|
|
|
|
* Copyright (C) 2006 Atmark Techno, Inc.
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze")
|
|
|
|
OUTPUT_ARCH(microblaze)
|
|
|
|
ENTRY(_start)
|
|
|
|
|
2009-09-07 05:10:10 +02:00
|
|
|
#include <asm/page.h>
|
2009-09-22 09:58:56 +02:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
2009-09-07 05:10:10 +02:00
|
|
|
#include <asm/thread_info.h>
|
2009-03-27 14:25:20 +01:00
|
|
|
|
|
|
|
jiffies = jiffies_64 + 4;
|
|
|
|
|
|
|
|
SECTIONS {
|
2009-05-26 16:30:24 +02:00
|
|
|
. = CONFIG_KERNEL_START;
|
2009-06-22 12:55:32 +02:00
|
|
|
_start = CONFIG_KERNEL_BASE_ADDR;
|
2009-09-22 09:58:56 +02:00
|
|
|
.text : AT(ADDR(.text) - LOAD_OFFSET) {
|
2009-03-27 14:25:20 +01:00
|
|
|
_text = . ;
|
|
|
|
_stext = . ;
|
2010-04-10 05:03:37 +02:00
|
|
|
HEAD_TEXT
|
|
|
|
TEXT_TEXT
|
2009-03-27 14:25:20 +01:00
|
|
|
*(.fixup)
|
2009-11-06 12:27:25 +01:00
|
|
|
EXIT_TEXT
|
|
|
|
EXIT_CALL
|
2009-03-27 14:25:20 +01:00
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
2009-11-06 12:27:25 +01:00
|
|
|
IRQENTRY_TEXT
|
2009-03-27 14:25:20 +01:00
|
|
|
. = ALIGN (4) ;
|
|
|
|
_etext = . ;
|
|
|
|
}
|
|
|
|
|
|
|
|
. = ALIGN (4) ;
|
2009-09-22 09:58:56 +02:00
|
|
|
__fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
|
|
|
|
_fdt_start = . ; /* place for fdt blob */
|
|
|
|
*(__fdt_blob) ; /* Any link-placed DTB */
|
|
|
|
. = _fdt_start + 0x4000; /* Pad up to 16kbyte */
|
|
|
|
_fdt_end = . ;
|
|
|
|
}
|
2009-03-27 14:25:20 +01:00
|
|
|
|
|
|
|
. = ALIGN(16);
|
|
|
|
RODATA
|
2009-09-07 05:10:10 +02:00
|
|
|
EXCEPTION_TABLE(16)
|
2009-03-27 14:25:20 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* sdata2 section can go anywhere, but must be word aligned
|
|
|
|
* and SDA2_BASE must point to the middle of it
|
|
|
|
*/
|
2009-09-22 09:58:56 +02:00
|
|
|
.sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
|
2009-03-27 14:25:20 +01:00
|
|
|
_ssrw = .;
|
|
|
|
. = ALIGN(4096); /* page aligned when MMU used - origin 0x8 */
|
|
|
|
*(.sdata2)
|
|
|
|
. = ALIGN(8);
|
|
|
|
_essrw = .;
|
|
|
|
_ssrw_size = _essrw - _ssrw;
|
|
|
|
_KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
_sdata = . ;
|
2009-09-07 05:10:10 +02:00
|
|
|
RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
|
2009-03-27 14:25:20 +01:00
|
|
|
_edata = . ;
|
|
|
|
|
|
|
|
/* Reserve some low RAM for r0 based memory references */
|
|
|
|
. = ALIGN(0x4) ;
|
|
|
|
r0_ram = . ;
|
|
|
|
. = . + 4096; /* a page should be enough */
|
|
|
|
|
|
|
|
/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
|
|
|
|
. = ALIGN(8);
|
2009-09-22 09:58:56 +02:00
|
|
|
.sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
|
2009-03-27 14:25:20 +01:00
|
|
|
_ssro = .;
|
|
|
|
*(.sdata)
|
|
|
|
}
|
|
|
|
|
2009-09-22 09:58:56 +02:00
|
|
|
.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {
|
2009-03-27 14:25:20 +01:00
|
|
|
_ssbss = .;
|
|
|
|
*(.sbss)
|
|
|
|
_esbss = .;
|
|
|
|
_essro = .;
|
|
|
|
_ssro_size = _essro - _ssro ;
|
|
|
|
_KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
|
|
|
|
}
|
|
|
|
|
2009-10-30 14:41:52 +01:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2009-03-27 14:25:20 +01:00
|
|
|
__init_begin = .;
|
|
|
|
|
2009-09-07 05:10:10 +02:00
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
2009-03-27 14:25:20 +01:00
|
|
|
|
2009-09-22 09:58:56 +02:00
|
|
|
.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
|
2009-06-20 14:24:01 +02:00
|
|
|
INIT_DATA
|
|
|
|
}
|
2009-03-27 14:25:20 +01:00
|
|
|
|
|
|
|
. = ALIGN(4);
|
2009-09-22 09:58:56 +02:00
|
|
|
.init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
|
2009-03-27 14:25:20 +01:00
|
|
|
__ivt_start = .;
|
|
|
|
*(.init.ivt)
|
|
|
|
__ivt_end = .;
|
|
|
|
}
|
|
|
|
|
2009-09-22 09:58:56 +02:00
|
|
|
.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
|
2009-09-07 05:10:10 +02:00
|
|
|
INIT_SETUP(0)
|
2009-03-27 14:25:20 +01:00
|
|
|
}
|
|
|
|
|
2009-09-22 09:58:56 +02:00
|
|
|
.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
|
2009-09-07 05:10:10 +02:00
|
|
|
INIT_CALLS
|
2009-03-27 14:25:20 +01:00
|
|
|
}
|
|
|
|
|
2009-09-22 09:58:56 +02:00
|
|
|
.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
|
2009-09-07 05:10:10 +02:00
|
|
|
CON_INITCALL
|
2009-03-27 14:25:20 +01:00
|
|
|
}
|
|
|
|
|
2009-05-01 23:36:44 +02:00
|
|
|
SECURITY_INIT
|
|
|
|
|
2009-03-27 14:25:20 +01:00
|
|
|
__init_end_before_initramfs = .;
|
|
|
|
|
2009-09-22 09:58:56 +02:00
|
|
|
.init.ramfs ALIGN(4096) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
|
2009-03-27 14:25:20 +01:00
|
|
|
__initramfs_start = .;
|
|
|
|
*(.init.ramfs)
|
|
|
|
__initramfs_end = .;
|
|
|
|
. = ALIGN(4);
|
|
|
|
LONG(0);
|
|
|
|
/*
|
|
|
|
* FIXME this can break initramfs for MMU.
|
|
|
|
* Pad init.ramfs up to page boundary,
|
|
|
|
* so that __init_end == __bss_start. This will make image.elf
|
|
|
|
* consistent with the image.bin
|
|
|
|
*/
|
|
|
|
/* . = ALIGN(4096); */
|
|
|
|
}
|
|
|
|
__init_end = .;
|
|
|
|
|
2009-09-22 09:58:56 +02:00
|
|
|
.bss ALIGN (4096) : AT(ADDR(.bss) - LOAD_OFFSET) {
|
|
|
|
/* page aligned when MMU used */
|
2009-03-27 14:25:20 +01:00
|
|
|
__bss_start = . ;
|
|
|
|
*(.bss*)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN (4) ;
|
|
|
|
__bss_stop = . ;
|
|
|
|
_ebss = . ;
|
|
|
|
}
|
|
|
|
. = ALIGN(4096);
|
|
|
|
_end = .;
|
2009-06-24 08:13:38 +02:00
|
|
|
|
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 04:27:40 +02:00
|
|
|
DISCARDS
|
2009-03-27 14:25:20 +01:00
|
|
|
}
|