2008-02-08 12:19:31 +00:00
|
|
|
/* MN10300 Main kernel linker script
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
|
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public Licence
|
|
|
|
* as published by the Free Software Foundation; either version
|
|
|
|
* 2 of the Licence, or (at your option) any later version.
|
|
|
|
*/
|
|
|
|
#define __VMLINUX_LDS__
|
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
#include <asm/thread_info.h>
|
2008-12-10 12:43:19 +00:00
|
|
|
#include <asm/page.h>
|
2008-02-08 12:19:31 +00:00
|
|
|
|
|
|
|
OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin")
|
|
|
|
OUTPUT_ARCH(mn10300)
|
|
|
|
ENTRY(_start)
|
|
|
|
jiffies = jiffies_64;
|
|
|
|
#ifndef CONFIG_MN10300_CURRENT_IN_E2
|
|
|
|
current = __current;
|
|
|
|
#endif
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
. = CONFIG_KERNEL_TEXT_ADDRESS;
|
|
|
|
/* read-only */
|
|
|
|
_stext = .;
|
|
|
|
_text = .; /* Text and read-only data */
|
|
|
|
.text : {
|
2009-04-26 02:11:04 +00:00
|
|
|
HEAD_TEXT
|
2008-02-08 12:19:31 +00:00
|
|
|
TEXT_TEXT
|
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
|
|
|
*(.fixup)
|
|
|
|
*(.gnu.warning)
|
|
|
|
} = 0xcb
|
|
|
|
|
|
|
|
_etext = .; /* End of text section */
|
|
|
|
|
2009-06-22 14:32:36 +00:00
|
|
|
EXCEPTION_TABLE(16)
|
2008-02-08 12:19:31 +00:00
|
|
|
BUG_TABLE
|
|
|
|
|
2009-06-22 14:32:36 +00:00
|
|
|
RO_DATA(PAGE_SIZE)
|
2008-02-08 12:19:31 +00:00
|
|
|
|
|
|
|
/* writeable */
|
2009-09-24 14:36:22 +00:00
|
|
|
RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
|
|
|
|
_edata = .;
|
2008-02-08 12:19:31 +00:00
|
|
|
|
|
|
|
/* might get freed after init */
|
2008-12-10 12:43:19 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2008-02-08 12:19:31 +00:00
|
|
|
.smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
|
|
|
|
__smp_locks = .;
|
|
|
|
*(.smp_locks)
|
|
|
|
__smp_locks_end = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* will be freed after init */
|
2008-12-10 12:43:19 +00:00
|
|
|
. = ALIGN(PAGE_SIZE); /* Init code and data */
|
2008-02-08 12:19:31 +00:00
|
|
|
__init_begin = .;
|
2009-09-24 14:36:22 +00:00
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
|
|
|
INIT_DATA_SECTION(16)
|
2008-02-08 12:19:31 +00:00
|
|
|
. = ALIGN(4);
|
|
|
|
__alt_instructions = .;
|
|
|
|
.altinstructions : { *(.altinstructions) }
|
|
|
|
__alt_instructions_end = .;
|
|
|
|
.altinstr_replacement : { *(.altinstr_replacement) }
|
|
|
|
/* .exit.text is discard at runtime, not link time, to deal with references
|
|
|
|
from .altinstructions and .eh_frame */
|
2009-06-22 14:32:36 +00:00
|
|
|
.exit.text : { EXIT_TEXT; }
|
|
|
|
.exit.data : { EXIT_DATA; }
|
2008-02-08 12:19:31 +00:00
|
|
|
|
2011-01-25 13:26:50 +00:00
|
|
|
PERCPU(32, PAGE_SIZE)
|
2008-12-10 12:43:19 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2008-02-08 12:19:31 +00:00
|
|
|
__init_end = .;
|
|
|
|
/* freed after init ends here */
|
|
|
|
|
2009-07-12 22:23:33 +00:00
|
|
|
BSS_SECTION(0, PAGE_SIZE, 4)
|
2008-02-08 12:19:31 +00:00
|
|
|
|
|
|
|
_end = . ;
|
|
|
|
|
|
|
|
/* This is where the kernel creates the early boot page tables */
|
2008-12-10 12:43:19 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2008-02-08 12:19:31 +00:00
|
|
|
pg0 = .;
|
|
|
|
|
|
|
|
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 02:27:40 +00:00
|
|
|
|
|
|
|
/* Sections to be discarded */
|
|
|
|
DISCARDS
|
2008-02-08 12:19:31 +00:00
|
|
|
}
|