2009-05-09 08:36:10 -06:00
|
|
|
/*
|
|
|
|
* ld script to make SuperH Linux kernel
|
|
|
|
* Written by Niibe Yutaka and Paul Mundt
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_SUPERH64
|
2010-02-11 23:41:45 -07:00
|
|
|
#define LOAD_OFFSET PAGE_OFFSET
|
2009-05-09 08:36:10 -06:00
|
|
|
OUTPUT_ARCH(sh:sh5)
|
2005-04-16 16:20:36 -06:00
|
|
|
#else
|
2009-05-09 09:25:08 -06:00
|
|
|
#define LOAD_OFFSET 0
|
2009-05-09 08:36:10 -06:00
|
|
|
OUTPUT_ARCH(sh)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <asm/thread_info.h>
|
|
|
|
#include <asm/cache.h>
|
2009-08-13 10:58:43 -06:00
|
|
|
#include <asm/vmlinux.lds.h>
|
2009-05-09 08:36:10 -06:00
|
|
|
|
2010-02-16 05:43:38 -07:00
|
|
|
#ifdef CONFIG_PMB
|
|
|
|
#define MEMORY_OFFSET 0
|
2010-02-15 00:10:57 -07:00
|
|
|
#else
|
2010-02-16 05:43:38 -07:00
|
|
|
#define MEMORY_OFFSET __MEMORY_START
|
2010-02-15 00:10:57 -07:00
|
|
|
#endif
|
|
|
|
|
2009-05-09 08:36:10 -06:00
|
|
|
ENTRY(_start)
|
|
|
|
SECTIONS
|
|
|
|
{
|
2011-09-15 05:13:00 -06:00
|
|
|
. = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
|
2009-05-09 08:36:10 -06:00
|
|
|
|
2009-05-11 02:45:27 -06:00
|
|
|
_text = .; /* Text and read-only data */
|
|
|
|
|
2009-05-09 08:36:10 -06: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-11 23:41:45 -07:00
|
|
|
EXTRA_TEXT
|
2009-05-09 08:36:10 -06:00
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
|
|
|
IRQENTRY_TEXT
|
|
|
|
*(.fixup)
|
|
|
|
*(.gnu.warning)
|
|
|
|
_etext = .; /* End of text section */
|
|
|
|
} = 0x0009
|
|
|
|
|
2009-07-09 08:45:59 -06:00
|
|
|
EXCEPTION_TABLE(16)
|
2009-05-09 08:36:10 -06:00
|
|
|
NOTES
|
2010-01-27 06:03:11 -07:00
|
|
|
|
|
|
|
_sdata = .;
|
2009-05-09 08:36:10 -06:00
|
|
|
RO_DATA(PAGE_SIZE)
|
2009-07-09 08:45:59 -06:00
|
|
|
RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
|
2010-01-27 06:03:11 -07:00
|
|
|
_edata = .;
|
2009-05-09 08:36:10 -06:00
|
|
|
|
2009-08-13 10:58:43 -06:00
|
|
|
DWARF_EH_FRAME
|
|
|
|
|
2009-05-09 08:36:10 -06:00
|
|
|
. = ALIGN(PAGE_SIZE); /* Init code and data */
|
2009-07-09 08:45:59 -06:00
|
|
|
__init_begin = .;
|
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
|
|
|
INIT_DATA_SECTION(16)
|
2009-05-09 08:36:10 -06:00
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
.machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
|
|
|
|
__machvec_start = .;
|
|
|
|
*(.machvec.init)
|
|
|
|
__machvec_end = .;
|
|
|
|
}
|
|
|
|
|
2011-03-24 11:50:09 -06:00
|
|
|
PERCPU_SECTION(L1_CACHE_BYTES)
|
2009-05-09 08:36:10 -06: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 08:45:59 -06:00
|
|
|
__init_end = .;
|
2009-07-20 08:30:24 -06:00
|
|
|
BSS_SECTION(0, PAGE_SIZE, 4)
|
2009-07-09 08:45:59 -06:00
|
|
|
_ebss = .; /* uClinux MTD sucks */
|
|
|
|
_end = . ;
|
2009-05-09 08:36:10 -06: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-08 20:27:40 -06:00
|
|
|
|
|
|
|
DISCARDS
|
2009-05-09 08:36:10 -06:00
|
|
|
}
|