2005-04-17 02:20:36 +04:00
|
|
|
/*
|
|
|
|
* vmlinux.lds.S -- master linker script for m68knommu arch
|
|
|
|
*
|
2006-06-26 10:33:05 +04:00
|
|
|
* (C) Copyright 2002-2006, Greg Ungerer <gerg@snapgear.com>
|
2005-04-17 02:20:36 +04:00
|
|
|
*
|
2011-03-31 05:57:33 +04:00
|
|
|
* This linker script is equipped to build either ROM loaded or RAM
|
2006-06-28 10:44:14 +04:00
|
|
|
* run kernels.
|
2005-04-17 02:20:36 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
2009-10-18 21:23:49 +04:00
|
|
|
#include <asm/page.h>
|
2009-10-18 21:23:51 +04:00
|
|
|
#include <asm/thread_info.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
#if defined(CONFIG_RAMKERNEL)
|
2006-06-26 10:33:05 +04:00
|
|
|
#define RAM_START CONFIG_KERNELBASE
|
|
|
|
#define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE)
|
2005-04-17 02:20:36 +04:00
|
|
|
#define TEXT ram
|
|
|
|
#define DATA ram
|
|
|
|
#define INIT ram
|
2009-10-30 07:58:58 +03:00
|
|
|
#define BSSS ram
|
2005-04-17 02:20:36 +04:00
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
|
2006-06-26 10:33:05 +04:00
|
|
|
#define RAM_START CONFIG_RAMBASE
|
|
|
|
#define RAM_LENGTH CONFIG_RAMSIZE
|
2006-06-28 10:44:14 +04:00
|
|
|
#define ROMVEC_START CONFIG_ROMVEC
|
|
|
|
#define ROMVEC_LENGTH CONFIG_ROMVECSIZE
|
|
|
|
#define ROM_START CONFIG_ROMSTART
|
|
|
|
#define ROM_LENGTH CONFIG_ROMSIZE
|
2005-04-17 02:20:36 +04:00
|
|
|
#define TEXT rom
|
|
|
|
#define DATA ram
|
|
|
|
#define INIT ram
|
2009-10-30 07:58:58 +03:00
|
|
|
#define BSSS ram
|
2005-04-17 02:20:36 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DATA_ADDR
|
|
|
|
#define DATA_ADDR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
OUTPUT_ARCH(m68k)
|
|
|
|
ENTRY(_start)
|
|
|
|
|
|
|
|
MEMORY {
|
|
|
|
ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
|
|
|
|
#ifdef ROM_START
|
|
|
|
romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
|
|
|
|
rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
jiffies = jiffies_64 + 4;
|
|
|
|
|
|
|
|
SECTIONS {
|
|
|
|
|
|
|
|
#ifdef ROMVEC_START
|
|
|
|
. = ROMVEC_START ;
|
|
|
|
.romvec : {
|
|
|
|
__rom_start = . ;
|
|
|
|
_romvec = .;
|
2010-02-20 03:03:54 +03:00
|
|
|
*(.data..initvect)
|
2005-04-17 02:20:36 +04:00
|
|
|
} > romvec
|
|
|
|
#endif
|
|
|
|
|
|
|
|
.text : {
|
2006-12-07 04:14:04 +03:00
|
|
|
_text = .;
|
2005-04-17 02:20:36 +04:00
|
|
|
_stext = . ;
|
2008-07-11 09:29:36 +04:00
|
|
|
HEAD_TEXT
|
2007-05-13 02:31:33 +04:00
|
|
|
TEXT_TEXT
|
2005-04-17 02:20:36 +04:00
|
|
|
SCHED_TEXT
|
2008-05-01 06:16:46 +04:00
|
|
|
LOCK_TEXT
|
2010-02-20 03:03:48 +03:00
|
|
|
*(.text..lock)
|
2011-10-19 07:50:35 +04:00
|
|
|
*(.fixup)
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
. = ALIGN(16); /* Exception table */
|
|
|
|
__start___ex_table = .;
|
|
|
|
*(__ex_table)
|
|
|
|
__stop___ex_table = .;
|
|
|
|
|
|
|
|
*(.rodata) *(.rodata.*)
|
|
|
|
*(__vermagic) /* Kernel version magic */
|
|
|
|
*(.rodata1)
|
|
|
|
*(.rodata.str1.1)
|
|
|
|
|
|
|
|
/* Kernel symbol table: Normal symbols */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__start___ksymtab = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___ksymtab+*))
|
2005-04-17 02:20:36 +04:00
|
|
|
__stop___ksymtab = .;
|
|
|
|
|
|
|
|
/* Kernel symbol table: GPL-only symbols */
|
|
|
|
__start___ksymtab_gpl = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___ksymtab_gpl+*))
|
2005-04-17 02:20:36 +04:00
|
|
|
__stop___ksymtab_gpl = .;
|
|
|
|
|
2007-02-07 04:45:43 +03:00
|
|
|
/* Kernel symbol table: Normal unused symbols */
|
|
|
|
__start___ksymtab_unused = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___ksymtab_unused+*))
|
2007-02-07 04:45:43 +03:00
|
|
|
__stop___ksymtab_unused = .;
|
|
|
|
|
|
|
|
/* Kernel symbol table: GPL-only unused symbols */
|
|
|
|
__start___ksymtab_unused_gpl = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___ksymtab_unused_gpl+*))
|
2007-02-07 04:45:43 +03:00
|
|
|
__stop___ksymtab_unused_gpl = .;
|
|
|
|
|
2006-03-21 00:17:13 +03:00
|
|
|
/* Kernel symbol table: GPL-future symbols */
|
|
|
|
__start___ksymtab_gpl_future = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___ksymtab_gpl_future+*))
|
2006-03-21 00:17:13 +03:00
|
|
|
__stop___ksymtab_gpl_future = .;
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
/* Kernel symbol table: Normal symbols */
|
|
|
|
__start___kcrctab = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___kcrctab+*))
|
2005-04-17 02:20:36 +04:00
|
|
|
__stop___kcrctab = .;
|
|
|
|
|
|
|
|
/* Kernel symbol table: GPL-only symbols */
|
|
|
|
__start___kcrctab_gpl = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___kcrctab_gpl+*))
|
2005-04-17 02:20:36 +04:00
|
|
|
__stop___kcrctab_gpl = .;
|
|
|
|
|
2008-05-13 01:02:23 +04:00
|
|
|
/* Kernel symbol table: Normal unused symbols */
|
|
|
|
__start___kcrctab_unused = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___kcrctab_unused+*))
|
2008-05-13 01:02:23 +04:00
|
|
|
__stop___kcrctab_unused = .;
|
|
|
|
|
|
|
|
/* Kernel symbol table: GPL-only unused symbols */
|
|
|
|
__start___kcrctab_unused_gpl = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___kcrctab_unused_gpl+*))
|
2008-05-13 01:02:23 +04:00
|
|
|
__stop___kcrctab_unused_gpl = .;
|
|
|
|
|
2006-03-21 00:17:13 +03:00
|
|
|
/* Kernel symbol table: GPL-future symbols */
|
|
|
|
__start___kcrctab_gpl_future = .;
|
2011-06-02 08:09:32 +04:00
|
|
|
*(SORT(___kcrctab_gpl_future+*))
|
2006-03-21 00:17:13 +03:00
|
|
|
__stop___kcrctab_gpl_future = .;
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
/* Kernel symbol table: strings */
|
|
|
|
*(__ksymtab_strings)
|
|
|
|
|
|
|
|
/* Built-in module parameters */
|
2005-11-07 07:09:50 +03:00
|
|
|
. = ALIGN(4) ;
|
2005-04-17 02:20:36 +04:00
|
|
|
__start___param = .;
|
|
|
|
*(__param)
|
|
|
|
__stop___param = .;
|
|
|
|
|
2011-02-08 07:45:59 +03:00
|
|
|
/* Built-in module versions */
|
|
|
|
. = ALIGN(4) ;
|
|
|
|
__start___modver = .;
|
|
|
|
*(__modver)
|
|
|
|
__stop___modver = .;
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
. = ALIGN(4) ;
|
|
|
|
_etext = . ;
|
|
|
|
} > TEXT
|
|
|
|
|
|
|
|
.data DATA_ADDR : {
|
|
|
|
. = ALIGN(4);
|
|
|
|
_sdata = . ;
|
2007-05-17 15:38:44 +04:00
|
|
|
DATA_DATA
|
2009-10-18 21:23:51 +04:00
|
|
|
CACHELINE_ALIGNED_DATA(32)
|
2010-09-03 05:15:19 +04:00
|
|
|
PAGE_ALIGNED_DATA(PAGE_SIZE)
|
|
|
|
*(.data..shared_aligned)
|
2009-10-18 21:23:51 +04:00
|
|
|
INIT_TASK_DATA(THREAD_SIZE)
|
2005-04-17 02:20:36 +04:00
|
|
|
_edata = . ;
|
|
|
|
} > DATA
|
|
|
|
|
2011-10-19 07:50:35 +04:00
|
|
|
.m68k_fixup : {
|
|
|
|
__start_fixup = .;
|
|
|
|
*(.m68k_fixup)
|
|
|
|
__stop_fixup = .;
|
|
|
|
} > DATA
|
|
|
|
NOTES > DATA
|
|
|
|
|
2009-10-18 21:23:55 +04:00
|
|
|
.init.text : {
|
2009-10-18 21:23:49 +04:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2005-04-17 02:20:36 +04:00
|
|
|
__init_begin = .;
|
2009-10-18 21:23:53 +04:00
|
|
|
} > INIT
|
2009-10-18 21:23:55 +04:00
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE) > INIT
|
|
|
|
INIT_DATA_SECTION(16) > INIT
|
|
|
|
.init.data : {
|
2009-10-18 21:23:49 +04:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2005-04-17 02:20:36 +04:00
|
|
|
__init_end = .;
|
|
|
|
} > INIT
|
|
|
|
|
|
|
|
.bss : {
|
|
|
|
. = ALIGN(4);
|
|
|
|
_sbss = . ;
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN(4) ;
|
|
|
|
_ebss = . ;
|
2008-05-01 06:16:46 +04:00
|
|
|
_end = . ;
|
2009-10-30 07:58:58 +03:00
|
|
|
} > BSSS
|
2005-04-17 02:20:36 +04: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 06:27:40 +04:00
|
|
|
DISCARDS
|
2005-04-17 02:20:36 +04:00
|
|
|
}
|
|
|
|
|