blob: 9bf0e3df7c5a6191e6d322c3a431b662d739b931 [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}
Sam Ravnborg51b563f2009-09-20 12:28:22 +020013
14ifdef CONFIG_32BIT
15 ifdef CONFIG_CPU_LITTLE_ENDIAN
16 jiffies = jiffies_64;
17 else
18 jiffies = jiffies_64 + 4;
19 endif
20else
21 jiffies = jiffies_64;
22endif
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020023
Linus Torvalds1da177e2005-04-16 15:20:36 -070024SECTIONS
25{
26#ifdef CONFIG_BOOT_ELF64
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020027 /* Read-only sections, merged into text segment: */
28 /* . = 0xc000000000000000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020030 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
31 /* . = 0xc00000000001c000; */
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020033 /* Set the vaddr for the text segment to a value
34 * >= 0xa800 0000 0001 9000 if no symmon is going to configured
35 * >= 0xa800 0000 0030 0000 otherwise
36 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020038 /* . = 0xa800000000300000; */
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020039 . = 0xffffffff80300000;
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#endif
Sam Ravnborg51b563f2009-09-20 12:28:22 +020041 . = VMLINUX_LOAD_ADDRESS;
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020042 /* read-only */
43 _text = .; /* Text and read-only data */
44 .text : {
45 TEXT_TEXT
46 SCHED_TEXT
47 LOCK_TEXT
Ralf Baechlef70fd1b2007-10-14 22:50:05 +010048 KPROBES_TEXT
Atsushi Nemoto6b3766a2008-08-05 23:45:14 +090049 *(.text.*)
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020050 *(.fixup)
51 *(.gnu.warning)
Ralf Baechle603bb992007-10-14 22:49:01 +010052 } :text = 0
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020053 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
Nelson Elhage6eb10bc2009-07-31 16:58:19 -040055 EXCEPTION_TABLE(16)
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020057 /* Exception table for data bus errors */
58 __dbe_table : {
59 __start___dbe_table = .;
60 *(__dbe_table)
61 __stop___dbe_table = .;
62 }
Ralf Baechle603bb992007-10-14 22:49:01 +010063
64 NOTES :text :note
65 .dummy : { *(.dummy) } :text
66
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020067 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020069 /* writeable */
70 .data : { /* Data */
Franck Bui-Huu16be2432007-10-18 23:12:32 +020071 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Nelson Elhage6eb10bc2009-07-31 16:58:19 -040073 INIT_TASK_DATA(PAGE_SIZE)
74 NOSAVE_DATA
75 CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
Franck Bui-Huu16be2432007-10-18 23:12:32 +020076 DATA_DATA
77 CONSTRUCTORS
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020078 }
79 _gp = . + 0x8000;
80 .lit8 : {
81 *(.lit8)
82 }
83 .lit4 : {
84 *(.lit4)
85 }
86 /* We want the small data sections together, so single-instruction offsets
87 can access them all, and initialized data all before uninitialized, so
88 we can shorten the on-disk segment size. */
89 .sdata : {
90 *(.sdata)
91 }
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020092 _edata = .; /* End of data section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020094 /* will be freed after init */
Nelson Elhagea0b54e22009-07-31 16:58:18 -040095 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborg0f5c9062007-09-15 23:35:53 +020096 __init_begin = .;
Nelson Elhage6eb10bc2009-07-31 16:58:19 -040097 INIT_TEXT_SECTION(PAGE_SIZE)
98 INIT_DATA_SECTION(16)
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200100 /* .exit.text is discarded at runtime, not link time, to deal with
101 * references from .rodata
102 */
103 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100104 EXIT_TEXT
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200105 }
106 .exit.data : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100107 EXIT_DATA
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200108 }
Nelson Elhage6eb10bc2009-07-31 16:58:19 -0400109
Nelson Elhagea0b54e22009-07-31 16:58:18 -0400110 PERCPU(PAGE_SIZE)
111 . = ALIGN(PAGE_SIZE);
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200112 __init_end = .;
113 /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114
Nelson Elhage6eb10bc2009-07-31 16:58:19 -0400115 BSS_SECTION(0, 0, 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200117 _end = . ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200119 /* These mark the ABI of the kernel for debuggers. */
120 .mdebug.abi32 : {
121 KEEP(*(.mdebug.abi32))
122 }
123 .mdebug.abi64 : {
124 KEEP(*(.mdebug.abi64))
125 }
Daniel Jacobowitz6c769882007-08-03 11:43:01 -0400126
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200127 /* This is the MIPS specific mdebug section. */
128 .mdebug : {
129 *(.mdebug)
130 }
Atsushi Nemoto78665aa2006-05-11 00:41:26 +0900131
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200132 STABS_DEBUG
133 DWARF_DEBUG
Atsushi Nemoto04b6b3b2006-05-10 15:36:04 +0900134
Sam Ravnborg0f5c9062007-09-15 23:35:53 +0200135 /* These must appear regardless of . */
136 .gptab.sdata : {
137 *(.gptab.data)
138 *(.gptab.sdata)
139 }
140 .gptab.sbss : {
141 *(.gptab.bss)
142 *(.gptab.sbss)
143 }
Tejun Heo023bf6f2009-07-09 11:27:40 +0900144
145 /* Sections to be discarded */
146 DISCARDS
147 /DISCARD/ : {
148 /* ABI crap starts here */
149 *(.MIPS.options)
150 *(.options)
151 *(.pdr)
152 *(.reginfo)
153 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154}