2009-05-09 21:36:10 +07:00
|
|
|
/*
|
|
|
|
* ld script to make SuperH Linux kernel
|
|
|
|
* Written by Niibe Yutaka and Paul Mundt
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_SUPERH64
|
|
|
|
#define LOAD_OFFSET CONFIG_PAGE_OFFSET
|
|
|
|
OUTPUT_ARCH(sh:sh5)
|
2005-04-17 05:20:36 +07:00
|
|
|
#else
|
2009-05-09 22:25:08 +07:00
|
|
|
#define LOAD_OFFSET 0
|
2009-05-09 21:36:10 +07:00
|
|
|
OUTPUT_ARCH(sh)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <asm/thread_info.h>
|
|
|
|
#include <asm/cache.h>
|
2009-08-13 23:58:43 +07:00
|
|
|
#include <asm/vmlinux.lds.h>
|
2009-05-09 21:36:10 +07:00
|
|
|
|
2010-01-13 16:31:48 +07:00
|
|
|
#if defined(CONFIG_32BIT) && !defined(CONFIG_PMB_LEGACY)
|
|
|
|
#define MEMORY_OFFSET 0
|
|
|
|
#else
|
|
|
|
#define MEMORY_OFFSET (CONFIG_MEMORY_START & 0x1fffffff)
|
|
|
|
#endif
|
|
|
|
|
2009-05-09 21:36:10 +07:00
|
|
|
ENTRY(_start)
|
|
|
|
SECTIONS
|
|
|
|
{
|
2010-01-13 16:31:48 +07:00
|
|
|
. = CONFIG_PAGE_OFFSET + MEMORY_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
|
2009-05-09 21:36:10 +07:00
|
|
|
|
2009-05-11 15:45:27 +07:00
|
|
|
_text = .; /* Text and read-only data */
|
|
|
|
|
2009-05-09 21:36:10 +07:00
|
|
|
.empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) {
|
|
|
|
*(.empty_zero_page)
|
|
|
|
} = 0
|
|
|
|
|
|
|
|
.text : AT(ADDR(.text) - LOAD_OFFSET) {
|
|
|
|
HEAD_TEXT
|
|
|
|
TEXT_TEXT
|
|
|
|
|
|
|
|
#ifdef CONFIG_SUPERH64
|
|
|
|
*(.text64)
|
|
|
|
*(.text..SHmedia32)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
|
|
|
IRQENTRY_TEXT
|
|
|
|
*(.fixup)
|
|
|
|
*(.gnu.warning)
|
|
|
|
_etext = .; /* End of text section */
|
|
|
|
} = 0x0009
|
|
|
|
|
2009-07-09 21:45:59 +07:00
|
|
|
EXCEPTION_TABLE(16)
|
2009-05-09 21:36:10 +07:00
|
|
|
|
|
|
|
NOTES
|
|
|
|
RO_DATA(PAGE_SIZE)
|
2009-07-09 21:45:59 +07:00
|
|
|
RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
|
2009-05-09 21:36:10 +07:00
|
|
|
|
|
|
|
_edata = .; /* End of data section */
|
|
|
|
|
2009-08-13 23:58:43 +07:00
|
|
|
DWARF_EH_FRAME
|
|
|
|
|
2009-05-09 21:36:10 +07:00
|
|
|
. = ALIGN(PAGE_SIZE); /* Init code and data */
|
2009-07-09 21:45:59 +07:00
|
|
|
__init_begin = .;
|
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
|
|
|
INIT_DATA_SECTION(16)
|
2009-05-09 21:36:10 +07:00
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
.machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
|
|
|
|
__machvec_start = .;
|
|
|
|
*(.machvec.init)
|
|
|
|
__machvec_end = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
PERCPU(PAGE_SIZE)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* .exit.text is discarded at runtime, not link time, to deal with
|
|
|
|
* references from __bug_table
|
|
|
|
*/
|
|
|
|
.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT }
|
|
|
|
.exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA }
|
|
|
|
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
2009-07-09 21:45:59 +07:00
|
|
|
__init_end = .;
|
2009-07-20 21:30:24 +07:00
|
|
|
BSS_SECTION(0, PAGE_SIZE, 4)
|
2009-07-09 21:45:59 +07:00
|
|
|
_ebss = .; /* uClinux MTD sucks */
|
|
|
|
_end = . ;
|
2009-05-09 21:36:10 +07:00
|
|
|
|
|
|
|
STABS_DEBUG
|
|
|
|
DWARF_DEBUG
|
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 09:27:40 +07:00
|
|
|
|
|
|
|
DISCARDS
|
2009-05-09 21:36:10 +07:00
|
|
|
}
|