blob: 60bbaecde1873d8d653664351692ca93576be2e5 [file] [log] [blame]
Ralf Baechledbee90b2006-02-02 14:31:16 +00001#include <asm/asm-offsets.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#include <asm-generic/vmlinux.lds.h>
3
Ralf Baechle41c594a2006-04-05 09:45:45 +01004#undef mips
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#define mips mips
6OUTPUT_ARCH(mips)
7ENTRY(kernel_entry)
8jiffies = JIFFIES;
9SECTIONS
10{
11#ifdef CONFIG_BOOT_ELF64
12 /* Read-only sections, merged into text segment: */
13 /* . = 0xc000000000000000; */
14
15 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
16 /* . = 0xc00000000001c000; */
17
Ralf Baechle42a3b4f2005-09-03 15:56:17 -070018 /* Set the vaddr for the text segment to a value
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 >= 0xa800 0000 0001 9000 if no symmon is going to configured
20 >= 0xa800 0000 0030 0000 otherwise */
21
22 /* . = 0xa800000000300000; */
23 /* . = 0xa800000000300000; */
24 . = 0xffffffff80300000;
25#endif
26 . = LOADADDR;
27 /* read-only */
28 _text = .; /* Text and read-only data */
29 .text : {
Sam Ravnborg76647092007-05-13 00:31:33 +020030 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 SCHED_TEXT
32 LOCK_TEXT
33 *(.fixup)
34 *(.gnu.warning)
35 } =0
36
37 _etext = .; /* End of text section */
38
39 . = ALIGN(16); /* Exception table */
40 __start___ex_table = .;
41 __ex_table : { *(__ex_table) }
42 __stop___ex_table = .;
43
44 __start___dbe_table = .; /* Exception table for data bus errors */
45 __dbe_table : { *(__dbe_table) }
46 __stop___dbe_table = .;
47
48 RODATA
49
50 /* writeable */
51 .data : { /* Data */
52 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
Ralf Baechle242954b2006-10-24 02:29:01 +010053 /*
54 * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
55 * limits the maximum alignment to at most 32kB and results in the following
56 * warning:
57 *
58 * CC arch/mips/kernel/init_task.o
59 * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
60 * is greater than maximum object file alignment. Using 32768
61 */
62 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 *(.data.init_task)
64
Sam Ravnborgca967252007-05-17 13:38:44 +020065 DATA_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 CONSTRUCTORS
68 }
69 _gp = . + 0x8000;
70 .lit8 : { *(.lit8) }
71 .lit4 : { *(.lit4) }
72 /* We want the small data sections together, so single-instruction offsets
73 can access them all, and initialized data all before uninitialized, so
74 we can shorten the on-disk segment size. */
75 .sdata : { *(.sdata) }
76
Ralf Baechledbee90b2006-02-02 14:31:16 +000077 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 __nosave_begin = .;
79 .data_nosave : { *(.data.nosave) }
Ralf Baechledbee90b2006-02-02 14:31:16 +000080 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 __nosave_end = .;
82
83 . = ALIGN(32);
84 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
85
86 _edata = .; /* End of data section */
87
88 /* will be freed after init */
Ralf Baechledbee90b2006-02-02 14:31:16 +000089 . = ALIGN(_PAGE_SIZE); /* Init code and data */
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 __init_begin = .;
91 .init.text : {
92 _sinittext = .;
93 *(.init.text)
94 _einittext = .;
95 }
96 .init.data : { *(.init.data) }
97 . = ALIGN(16);
98 __setup_start = .;
99 .init.setup : { *(.init.setup) }
100 __setup_end = .;
101
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 __initcall_start = .;
103 .initcall.init : {
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700104 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105 }
106 __initcall_end = .;
107
108 __con_initcall_start = .;
109 .con_initcall.init : { *(.con_initcall.init) }
110 __con_initcall_end = .;
111 SECURITY_INIT
Ralf Baechle2efac772006-12-11 11:54:52 +0000112 /* .exit.text is discarded at runtime, not link time, to deal with
113 references from .rodata */
114 .exit.text : { *(.exit.text) }
115 .exit.data : { *(.exit.data) }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800116#if defined(CONFIG_BLK_DEV_INITRD)
Ralf Baechledbee90b2006-02-02 14:31:16 +0000117 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 __initramfs_start = .;
119 .init.ramfs : { *(.init.ramfs) }
120 __initramfs_end = .;
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800121#endif
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700122 PERCPU(_PAGE_SIZE)
Ralf Baechledbee90b2006-02-02 14:31:16 +0000123 . = ALIGN(_PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124 __init_end = .;
125 /* freed after init ends here */
126
127 __bss_start = .; /* BSS */
128 .sbss : {
129 *(.sbss)
130 *(.scommon)
131 }
132 .bss : {
133 *(.bss)
134 *(COMMON)
135 }
136 __bss_stop = .;
137
138 _end = . ;
139
140 /* Sections to be discarded */
141 /DISCARD/ : {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 *(.exitcall.exit)
143
144 /* ABI crap starts here */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 *(.MIPS.options)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 *(.options)
147 *(.pdr)
148 *(.reginfo)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 }
150
Daniel Jacobowitz6c769882007-08-03 11:43:01 -0400151 /* These mark the ABI of the kernel for debuggers. */
152 .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
153 .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
154
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155 /* This is the MIPS specific mdebug section. */
156 .mdebug : { *(.mdebug) }
Atsushi Nemoto78665aa2006-05-11 00:41:26 +0900157
158 STABS_DEBUG
Atsushi Nemoto04b6b3b2006-05-10 15:36:04 +0900159
160 DWARF_DEBUG
161
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162 /* These must appear regardless of . */
163 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
164 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 .note : { *(.note) }
166}