blob: 2769bed3d2afcb0af8b3ebb351ed39c5f5ba609a [file] [log] [blame]
Ralf Baechledbee90b2006-02-02 14:31:16 +00001#include <asm/asm-offsets.h>
Nelson Elhagea0b54e22009-07-31 16:58:18 -04002#include <asm/page.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07003#include <asm-generic/vmlinux.lds.h>
4
Ralf Baechle41c594a2006-04-05 09:45:45 +01005#undef mips
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#define mips mips
7OUTPUT_ARCH(mips)
8ENTRY(kernel_entry)
Ralf Baechle603bb992007-10-14 22:49:01 +01009PHDRS {
10 text PT_LOAD FLAGS(7); /* RWX */
11 note PT_NOTE FLAGS(4); /* R__ */
12}
Linus Torvalds1da177e2005-04-16 15:20:36 -070013jiffies = JIFFIES;
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020014
Linus Torvalds1da177e2005-04-16 15:20:36 -070015SECTIONS
16{
17#ifdef CONFIG_BOOT_ELF64
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020018 /* Read-only sections, merged into text segment: */
19 /* . = 0xc000000000000000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020021 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
22 /* . = 0xc00000000001c000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020024 /* Set the vaddr for the text segment to a value
25 * >= 0xa800 0000 0001 9000 if no symmon is going to configured
26 * >= 0xa800 0000 0030 0000 otherwise
27 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020029 /* . = 0xa800000000300000; */
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020030 . = 0xffffffff80300000;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#endif
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020032 . = LOADADDR;
33 /* read-only */
34 _text = .; /* Text and read-only data */
35 .text : {
36 TEXT_TEXT
37 SCHED_TEXT
38 LOCK_TEXT
Ralf Baechlef70fd1b2007-10-14 22:50:05 +010039 KPROBES_TEXT
Atsushi Nemoto6b3766a2008-08-05 23:45:14 +090040 *(.text.*)
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020041 *(.fixup)
42 *(.gnu.warning)
Ralf Baechle603bb992007-10-14 22:49:01 +010043 } :text = 0
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020044 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Nelson Elhage6eb10bc2009-07-31 16:58:19 -040046 EXCEPTION_TABLE(16)
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020048 /* Exception table for data bus errors */
49 __dbe_table : {
50 __start___dbe_table = .;
51 *(__dbe_table)
52 __stop___dbe_table = .;
53 }
Ralf Baechle603bb992007-10-14 22:49:01 +010054
55 NOTES :text :note
56 .dummy : { *(.dummy) } :text
57
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020058 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020060 /* writeable */
61 .data : { /* Data */
Franck Bui-Huu16be2432007-10-18 23:12:32 +020062 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Nelson Elhage6eb10bc2009-07-31 16:58:19 -040064 INIT_TASK_DATA(PAGE_SIZE)
65 NOSAVE_DATA
66 CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
Franck Bui-Huu16be2432007-10-18 23:12:32 +020067 DATA_DATA
68 CONSTRUCTORS
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020069 }
70 _gp = . + 0x8000;
71 .lit8 : {
72 *(.lit8)
73 }
74 .lit4 : {
75 *(.lit4)
76 }
77 /* We want the small data sections together, so single-instruction offsets
78 can access them all, and initialized data all before uninitialized, so
79 we can shorten the on-disk segment size. */
80 .sdata : {
81 *(.sdata)
82 }
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020083 _edata = .; /* End of data section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070084
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020085 /* will be freed after init */
Nelson Elhagea0b54e22009-07-31 16:58:18 -040086 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020087 __init_begin = .;
Nelson Elhage6eb10bc2009-07-31 16:58:19 -040088 INIT_TEXT_SECTION(PAGE_SIZE)
89 INIT_DATA_SECTION(16)
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020091 /* .exit.text is discarded at runtime, not link time, to deal with
92 * references from .rodata
93 */
94 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010095 EXIT_TEXT
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020096 }
97 .exit.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010098 EXIT_DATA
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020099 }
Nelson Elhage6eb10bc2009-07-31 16:58:19 -0400100
Nelson Elhagea0b54e22009-07-31 16:58:18 -0400101 PERCPU(PAGE_SIZE)
102 . = ALIGN(PAGE_SIZE);
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200103 __init_end = .;
104 /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
Nelson Elhage6eb10bc2009-07-31 16:58:19 -0400106 BSS_SECTION(0, 0, 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200108 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200110 /* These mark the ABI of the kernel for debuggers. */
111 .mdebug.abi32 : {
112 KEEP(*(.mdebug.abi32))
113 }
114 .mdebug.abi64 : {
115 KEEP(*(.mdebug.abi64))
116 }
Daniel Jacobowitz6c769882007-08-03 11:43:01 -0400117
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200118 /* This is the MIPS specific mdebug section. */
119 .mdebug : {
120 *(.mdebug)
121 }
Atsushi Nemoto78665aa2006-05-11 00:41:26 +0900122
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200123 STABS_DEBUG
124 DWARF_DEBUG
Atsushi Nemoto04b6b3b2006-05-10 15:36:04 +0900125
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200126 /* These must appear regardless of . */
127 .gptab.sdata : {
128 *(.gptab.data)
129 *(.gptab.sdata)
130 }
131 .gptab.sbss : {
132 *(.gptab.bss)
133 *(.gptab.sbss)
134 }
Tejun Heo023bf6f2009-07-09 11:27:40 +0900135
136 /* Sections to be discarded */
137 DISCARDS
138 /DISCARD/ : {
139 /* ABI crap starts here */
140 *(.MIPS.options)
141 *(.options)
142 *(.pdr)
143 *(.reginfo)
144 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145}