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
|
2010-02-12 13:41:45 +07:00
|
|
|
#define LOAD_OFFSET PAGE_OFFSET
|
2009-05-09 21:36:10 +07:00
|
|
|
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-02-16 19:43:38 +07:00
|
|
|
#ifdef CONFIG_PMB
|
|
|
|
#define MEMORY_OFFSET 0
|
2010-02-15 14:10:57 +07:00
|
|
|
#else
|
2010-02-16 19:43:38 +07:00
|
|
|
#define MEMORY_OFFSET __MEMORY_START
|
2010-02-15 14:10:57 +07:00
|
|
|
#endif
|
|
|
|
|
2009-05-09 21:36:10 +07:00
|
|
|
ENTRY(_start)
|
|
|
|
SECTIONS
|
|
|
|
{
|
2011-09-15 18:13:00 +07:00
|
|
|
. = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_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
|
2010-02-12 13:41:45 +07:00
|
|
|
EXTRA_TEXT
|
2009-05-09 21:36:10 +07:00
|
|
|
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
|
2010-01-27 20:03:11 +07:00
|
|
|
|
|
|
|
_sdata = .;
|
2009-05-09 21:36:10 +07:00
|
|
|
RO_DATA(PAGE_SIZE)
|
2009-07-09 21:45:59 +07:00
|
|
|
RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
|
2010-01-27 20:03:11 +07:00
|
|
|
_edata = .;
|
2009-05-09 21:36:10 +07:00
|
|
|
|
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 = .;
|
|
|
|
}
|
|
|
|
|
2011-03-25 00:50:09 +07:00
|
|
|
PERCPU_SECTION(L1_CACHE_BYTES)
|
2009-05-09 21:36:10 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* .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
|
|
|
_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
|
|
|
}
|