2006-02-02 22:31:16 +08:00
|
|
|
#include <asm/asm-offsets.h>
|
2012-07-19 15:11:14 +08:00
|
|
|
#include <asm/thread_info.h>
|
2012-08-15 02:08:01 +08:00
|
|
|
|
2012-12-28 22:15:25 +08:00
|
|
|
#define PAGE_SIZE _PAGE_SIZE
|
|
|
|
|
2012-08-15 02:08:01 +08:00
|
|
|
/*
|
|
|
|
* Put .bss..swapper_pg_dir as the first thing in .bss. This will
|
|
|
|
* ensure that it has .bss alignment (64K).
|
|
|
|
*/
|
|
|
|
#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
|
2006-04-05 16:45:45 +08:00
|
|
|
#undef mips
|
2005-04-17 06:20:36 +08:00
|
|
|
#define mips mips
|
|
|
|
OUTPUT_ARCH(mips)
|
|
|
|
ENTRY(kernel_entry)
|
2007-10-15 05:49:01 +08:00
|
|
|
PHDRS {
|
|
|
|
text PT_LOAD FLAGS(7); /* RWX */
|
|
|
|
note PT_NOTE FLAGS(4); /* R__ */
|
|
|
|
}
|
2009-09-20 18:28:22 +08:00
|
|
|
|
2009-09-25 03:44:24 +08:00
|
|
|
#ifdef CONFIG_32BIT
|
|
|
|
#ifdef CONFIG_CPU_LITTLE_ENDIAN
|
2013-01-22 19:59:30 +08:00
|
|
|
jiffies = jiffies_64;
|
2009-09-25 03:44:24 +08:00
|
|
|
#else
|
2013-01-22 19:59:30 +08:00
|
|
|
jiffies = jiffies_64 + 4;
|
2009-09-25 03:44:24 +08:00
|
|
|
#endif
|
|
|
|
#else
|
2013-01-22 19:59:30 +08:00
|
|
|
jiffies = jiffies_64;
|
2009-09-25 03:44:24 +08:00
|
|
|
#endif
|
2007-09-16 05:35:53 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_BOOT_ELF64
|
2007-09-16 05:35:53 +08:00
|
|
|
/* Read-only sections, merged into text segment: */
|
|
|
|
/* . = 0xc000000000000000; */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* This is the value for an Origin kernel, taken from an IRIX kernel. */
|
|
|
|
/* . = 0xc00000000001c000; */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* Set the vaddr for the text segment to a value
|
|
|
|
* >= 0xa800 0000 0001 9000 if no symmon is going to configured
|
|
|
|
* >= 0xa800 0000 0030 0000 otherwise
|
|
|
|
*/
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* . = 0xa800000000300000; */
|
|
|
|
. = 0xffffffff80300000;
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif
|
2009-09-20 18:28:22 +08:00
|
|
|
. = VMLINUX_LOAD_ADDRESS;
|
2007-09-16 05:35:53 +08:00
|
|
|
/* read-only */
|
|
|
|
_text = .; /* Text and read-only data */
|
|
|
|
.text : {
|
|
|
|
TEXT_TEXT
|
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
2007-10-15 05:50:05 +08:00
|
|
|
KPROBES_TEXT
|
2009-11-20 20:34:33 +08:00
|
|
|
IRQENTRY_TEXT
|
2008-08-05 22:45:14 +08:00
|
|
|
*(.text.*)
|
2007-09-16 05:35:53 +08:00
|
|
|
*(.fixup)
|
|
|
|
*(.gnu.warning)
|
2007-10-15 05:49:01 +08:00
|
|
|
} :text = 0
|
2007-09-16 05:35:53 +08:00
|
|
|
_etext = .; /* End of text section */
|
|
|
|
|
2009-08-01 04:58:19 +08:00
|
|
|
EXCEPTION_TABLE(16)
|
2007-09-16 05:35:53 +08:00
|
|
|
|
|
|
|
/* Exception table for data bus errors */
|
|
|
|
__dbe_table : {
|
|
|
|
__start___dbe_table = .;
|
|
|
|
*(__dbe_table)
|
|
|
|
__stop___dbe_table = .;
|
|
|
|
}
|
2007-10-15 05:49:01 +08:00
|
|
|
|
|
|
|
NOTES :text :note
|
|
|
|
.dummy : { *(.dummy) } :text
|
|
|
|
|
2011-05-20 09:34:58 +08:00
|
|
|
_sdata = .; /* Start of data section */
|
2007-09-16 05:35:53 +08:00
|
|
|
RODATA
|
|
|
|
|
|
|
|
/* writeable */
|
|
|
|
.data : { /* Data */
|
2007-10-19 05:12:32 +08:00
|
|
|
. = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
|
2007-09-16 05:35:53 +08:00
|
|
|
|
2012-07-19 15:11:14 +08:00
|
|
|
INIT_TASK_DATA(THREAD_SIZE)
|
2009-08-01 04:58:19 +08:00
|
|
|
NOSAVE_DATA
|
|
|
|
CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
2011-03-29 18:40:06 +08:00
|
|
|
READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
2007-10-19 05:12:32 +08:00
|
|
|
DATA_DATA
|
|
|
|
CONSTRUCTORS
|
2007-09-16 05:35:53 +08:00
|
|
|
}
|
|
|
|
_gp = . + 0x8000;
|
|
|
|
.lit8 : {
|
|
|
|
*(.lit8)
|
|
|
|
}
|
|
|
|
.lit4 : {
|
|
|
|
*(.lit4)
|
|
|
|
}
|
|
|
|
/* We want the small data sections together, so single-instruction offsets
|
|
|
|
can access them all, and initialized data all before uninitialized, so
|
|
|
|
we can shorten the on-disk segment size. */
|
|
|
|
.sdata : {
|
|
|
|
*(.sdata)
|
|
|
|
}
|
|
|
|
_edata = .; /* End of data section */
|
|
|
|
|
|
|
|
/* will be freed after init */
|
2009-08-01 04:58:18 +08:00
|
|
|
. = ALIGN(PAGE_SIZE); /* Init code and data */
|
2007-09-16 05:35:53 +08:00
|
|
|
__init_begin = .;
|
2009-08-01 04:58:19 +08:00
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
|
|
|
INIT_DATA_SECTION(16)
|
2007-09-16 05:35:53 +08:00
|
|
|
|
2010-11-23 23:06:25 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
.mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
|
|
|
|
__mips_machines_start = .;
|
|
|
|
*(.mips.machines.init)
|
|
|
|
__mips_machines_end = .;
|
|
|
|
}
|
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* .exit.text is discarded at runtime, not link time, to deal with
|
|
|
|
* references from .rodata
|
|
|
|
*/
|
|
|
|
.exit.text : {
|
2008-01-20 21:15:03 +08:00
|
|
|
EXIT_TEXT
|
2007-09-16 05:35:53 +08:00
|
|
|
}
|
|
|
|
.exit.data : {
|
2008-01-20 21:15:03 +08:00
|
|
|
EXIT_DATA
|
2007-09-16 05:35:53 +08:00
|
|
|
}
|
2009-08-01 04:58:19 +08:00
|
|
|
|
2011-03-25 01:50:09 +08:00
|
|
|
PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
2012-08-15 02:08:01 +08:00
|
|
|
/*
|
|
|
|
* Align to 64K in attempt to eliminate holes before the
|
|
|
|
* .bss..swapper_pg_dir section at the start of .bss. This
|
|
|
|
* also satisfies PAGE_SIZE alignment as the largest page size
|
|
|
|
* allowed is 64K.
|
|
|
|
*/
|
|
|
|
. = ALIGN(0x10000);
|
2007-09-16 05:35:53 +08:00
|
|
|
__init_end = .;
|
|
|
|
/* freed after init ends here */
|
|
|
|
|
2012-08-15 02:08:01 +08:00
|
|
|
/*
|
|
|
|
* Force .bss to 64K alignment so that .bss..swapper_pg_dir
|
2013-01-22 19:59:30 +08:00
|
|
|
* gets that alignment. .sbss should be empty, so there will be
|
2012-08-15 02:08:01 +08:00
|
|
|
* no holes after __init_end. */
|
|
|
|
BSS_SECTION(0, 0x10000, 0)
|
2007-09-16 05:35:53 +08:00
|
|
|
|
|
|
|
_end = . ;
|
|
|
|
|
|
|
|
/* These mark the ABI of the kernel for debuggers. */
|
|
|
|
.mdebug.abi32 : {
|
|
|
|
KEEP(*(.mdebug.abi32))
|
|
|
|
}
|
|
|
|
.mdebug.abi64 : {
|
|
|
|
KEEP(*(.mdebug.abi64))
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is the MIPS specific mdebug section. */
|
|
|
|
.mdebug : {
|
|
|
|
*(.mdebug)
|
|
|
|
}
|
|
|
|
|
|
|
|
STABS_DEBUG
|
|
|
|
DWARF_DEBUG
|
|
|
|
|
|
|
|
/* These must appear regardless of . */
|
|
|
|
.gptab.sdata : {
|
|
|
|
*(.gptab.data)
|
|
|
|
*(.gptab.sdata)
|
|
|
|
}
|
|
|
|
.gptab.sbss : {
|
|
|
|
*(.gptab.bss)
|
|
|
|
*(.gptab.sbss)
|
|
|
|
}
|
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 10:27:40 +08:00
|
|
|
|
|
|
|
/* Sections to be discarded */
|
|
|
|
DISCARDS
|
|
|
|
/DISCARD/ : {
|
|
|
|
/* ABI crap starts here */
|
|
|
|
*(.MIPS.options)
|
|
|
|
*(.options)
|
|
|
|
*(.pdr)
|
|
|
|
*(.reginfo)
|
2013-08-09 02:40:49 +08:00
|
|
|
*(.eh_frame)
|
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 10:27:40 +08:00
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|