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