2009-03-27 13:25:20 +00: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_ARCH(microblaze)
|
2010-07-28 07:29:11 +00:00
|
|
|
ENTRY(microblaze_start)
|
2009-03-27 13:25:20 +00:00
|
|
|
|
2009-09-07 03:10:10 +00:00
|
|
|
#include <asm/page.h>
|
2009-09-22 07:58:56 +00:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
2009-09-07 03:10:10 +00:00
|
|
|
#include <asm/thread_info.h>
|
2009-03-27 13:25:20 +00:00
|
|
|
|
2010-09-28 06:04:14 +00:00
|
|
|
#ifdef __MICROBLAZEEL__
|
|
|
|
jiffies = jiffies_64;
|
|
|
|
#else
|
2009-03-27 13:25:20 +00:00
|
|
|
jiffies = jiffies_64 + 4;
|
2010-09-28 06:04:14 +00:00
|
|
|
#endif
|
2009-03-27 13:25:20 +00:00
|
|
|
|
|
|
|
SECTIONS {
|
2009-05-26 14:30:24 +00:00
|
|
|
. = CONFIG_KERNEL_START;
|
2010-07-28 07:29:11 +00:00
|
|
|
microblaze_start = CONFIG_KERNEL_BASE_ADDR;
|
2009-09-22 07:58:56 +00:00
|
|
|
.text : AT(ADDR(.text) - LOAD_OFFSET) {
|
2009-03-27 13:25:20 +00:00
|
|
|
_text = . ;
|
|
|
|
_stext = . ;
|
2010-04-10 03:03:37 +00:00
|
|
|
HEAD_TEXT
|
|
|
|
TEXT_TEXT
|
2009-03-27 13:25:20 +00:00
|
|
|
*(.fixup)
|
2009-11-06 11:27:25 +00:00
|
|
|
EXIT_TEXT
|
|
|
|
EXIT_CALL
|
2009-03-27 13:25:20 +00:00
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
2009-11-06 11:27:25 +00:00
|
|
|
IRQENTRY_TEXT
|
2009-03-27 13:25:20 +00:00
|
|
|
. = ALIGN (4) ;
|
|
|
|
_etext = . ;
|
|
|
|
}
|
|
|
|
|
|
|
|
. = ALIGN (4) ;
|
2009-09-22 07:58:56 +00: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 13:25:20 +00:00
|
|
|
|
|
|
|
. = ALIGN(16);
|
|
|
|
RODATA
|
2009-09-07 03:10:10 +00:00
|
|
|
EXCEPTION_TABLE(16)
|
2009-03-27 13:25:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* sdata2 section can go anywhere, but must be word aligned
|
|
|
|
* and SDA2_BASE must point to the middle of it
|
|
|
|
*/
|
2009-09-22 07:58:56 +00:00
|
|
|
.sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
|
2009-03-27 13:25:20 +00:00
|
|
|
_ssrw = .;
|
2010-05-13 15:48:27 +00:00
|
|
|
. = ALIGN(PAGE_SIZE); /* page aligned when MMU used */
|
2009-03-27 13:25:20 +00:00
|
|
|
*(.sdata2)
|
|
|
|
. = ALIGN(8);
|
|
|
|
_essrw = .;
|
|
|
|
_ssrw_size = _essrw - _ssrw;
|
|
|
|
_KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
_sdata = . ;
|
2009-09-07 03:10:10 +00:00
|
|
|
RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
|
2009-03-27 13:25:20 +00:00
|
|
|
_edata = . ;
|
|
|
|
|
|
|
|
/* Reserve some low RAM for r0 based memory references */
|
|
|
|
. = ALIGN(0x4) ;
|
|
|
|
r0_ram = . ;
|
2010-05-13 15:48:27 +00:00
|
|
|
. = . + PAGE_SIZE; /* a page should be enough */
|
2009-03-27 13:25:20 +00:00
|
|
|
|
|
|
|
/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
|
|
|
|
. = ALIGN(8);
|
2009-09-22 07:58:56 +00:00
|
|
|
.sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
|
2009-03-27 13:25:20 +00:00
|
|
|
_ssro = .;
|
|
|
|
*(.sdata)
|
|
|
|
}
|
|
|
|
|
2009-09-22 07:58:56 +00:00
|
|
|
.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {
|
2009-03-27 13:25:20 +00:00
|
|
|
_ssbss = .;
|
|
|
|
*(.sbss)
|
|
|
|
_esbss = .;
|
|
|
|
_essro = .;
|
|
|
|
_ssro_size = _essro - _ssro ;
|
|
|
|
_KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
|
|
|
|
}
|
|
|
|
|
2009-10-30 13:41:52 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2009-03-27 13:25:20 +00:00
|
|
|
__init_begin = .;
|
|
|
|
|
2009-09-07 03:10:10 +00:00
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
2009-03-27 13:25:20 +00:00
|
|
|
|
2009-09-22 07:58:56 +00:00
|
|
|
.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
|
2009-06-20 12:24:01 +00:00
|
|
|
INIT_DATA
|
|
|
|
}
|
2009-03-27 13:25:20 +00:00
|
|
|
|
|
|
|
. = ALIGN(4);
|
2009-09-22 07:58:56 +00:00
|
|
|
.init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
|
2009-03-27 13:25:20 +00:00
|
|
|
__ivt_start = .;
|
|
|
|
*(.init.ivt)
|
|
|
|
__ivt_end = .;
|
|
|
|
}
|
|
|
|
|
2009-09-22 07:58:56 +00:00
|
|
|
.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
|
2009-09-07 03:10:10 +00:00
|
|
|
INIT_SETUP(0)
|
2009-03-27 13:25:20 +00:00
|
|
|
}
|
|
|
|
|
2009-09-22 07:58:56 +00:00
|
|
|
.initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
|
2009-09-07 03:10:10 +00:00
|
|
|
INIT_CALLS
|
2009-03-27 13:25:20 +00:00
|
|
|
}
|
|
|
|
|
2009-09-22 07:58:56 +00:00
|
|
|
.con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
|
2009-09-07 03:10:10 +00:00
|
|
|
CON_INITCALL
|
2009-03-27 13:25:20 +00:00
|
|
|
}
|
|
|
|
|
2009-05-01 21:36:44 +00:00
|
|
|
SECURITY_INIT
|
|
|
|
|
2009-03-27 13:25:20 +00:00
|
|
|
__init_end_before_initramfs = .;
|
|
|
|
|
2010-05-13 15:48:27 +00:00
|
|
|
.init.ramfs ALIGN(PAGE_SIZE) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
|
2009-03-27 13:25:20 +00: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
|
|
|
|
*/
|
2010-05-13 15:48:27 +00:00
|
|
|
/* . = ALIGN(PAGE_SIZE); */
|
2009-03-27 13:25:20 +00:00
|
|
|
}
|
|
|
|
__init_end = .;
|
|
|
|
|
2010-05-13 15:48:27 +00:00
|
|
|
.bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
|
2009-09-22 07:58:56 +00:00
|
|
|
/* page aligned when MMU used */
|
2009-03-27 13:25:20 +00:00
|
|
|
__bss_start = . ;
|
|
|
|
*(.bss*)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN (4) ;
|
|
|
|
__bss_stop = . ;
|
|
|
|
_ebss = . ;
|
|
|
|
}
|
2010-05-13 15:48:27 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2009-03-27 13:25:20 +00:00
|
|
|
_end = .;
|
2009-06-24 06:13:38 +00: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 02:27:40 +00:00
|
|
|
DISCARDS
|
2009-03-27 13:25:20 +00:00
|
|
|
}
|