linker script: throw away .discard section
[deliverable/linux.git] / arch / mips / kernel / vmlinux.lds.S
CommitLineData
dbee90b7 1#include <asm/asm-offsets.h>
1da177e4
LT
2#include <asm-generic/vmlinux.lds.h>
3
41c594ab 4#undef mips
1da177e4
LT
5#define mips mips
6OUTPUT_ARCH(mips)
7ENTRY(kernel_entry)
603bb99c
RB
8PHDRS {
9 text PT_LOAD FLAGS(7); /* RWX */
10 note PT_NOTE FLAGS(4); /* R__ */
11}
1da177e4 12jiffies = JIFFIES;
0f5c9064 13
1da177e4
LT
14SECTIONS
15{
16#ifdef CONFIG_BOOT_ELF64
0f5c9064
SR
17 /* Read-only sections, merged into text segment: */
18 /* . = 0xc000000000000000; */
1da177e4 19
0f5c9064
SR
20 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
21 /* . = 0xc00000000001c000; */
1da177e4 22
0f5c9064
SR
23 /* Set the vaddr for the text segment to a value
24 * >= 0xa800 0000 0001 9000 if no symmon is going to configured
25 * >= 0xa800 0000 0030 0000 otherwise
26 */
1da177e4 27
0f5c9064
SR
28 /* . = 0xa800000000300000; */
29 . = 0xffffffff80300000;
1da177e4 30#endif
0f5c9064
SR
31 . = LOADADDR;
32 /* read-only */
33 _text = .; /* Text and read-only data */
34 .text : {
35 TEXT_TEXT
36 SCHED_TEXT
37 LOCK_TEXT
f70fd1b5 38 KPROBES_TEXT
6b3766a2 39 *(.text.*)
0f5c9064
SR
40 *(.fixup)
41 *(.gnu.warning)
603bb99c 42 } :text = 0
0f5c9064
SR
43 _etext = .; /* End of text section */
44
45 /* Exception table */
46 . = ALIGN(16);
47 __ex_table : {
48 __start___ex_table = .;
49 *(__ex_table)
50 __stop___ex_table = .;
51 }
52
53 /* Exception table for data bus errors */
54 __dbe_table : {
55 __start___dbe_table = .;
56 *(__dbe_table)
57 __stop___dbe_table = .;
58 }
603bb99c
RB
59
60 NOTES :text :note
61 .dummy : { *(.dummy) } :text
62
0f5c9064
SR
63 RODATA
64
65 /* writeable */
66 .data : { /* Data */
16be2435
FBH
67 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
68 /*
69 * This ALIGN is needed as a workaround for a bug a
70 * gcc bug upto 4.1 which limits the maximum alignment
71 * to at most 32kB and results in the following
72 * warning:
73 *
74 * CC arch/mips/kernel/init_task.o
75 * arch/mips/kernel/init_task.c:30: warning: alignment
76 * of ‘init_thread_union’ is greater than maximum
77 * object file alignment. Using 32768
78 */
79 . = ALIGN(_PAGE_SIZE);
80 *(.data.init_task)
0f5c9064 81
16be2435
FBH
82 DATA_DATA
83 CONSTRUCTORS
0f5c9064
SR
84 }
85 _gp = . + 0x8000;
86 .lit8 : {
87 *(.lit8)
88 }
89 .lit4 : {
90 *(.lit4)
91 }
92 /* We want the small data sections together, so single-instruction offsets
93 can access them all, and initialized data all before uninitialized, so
94 we can shorten the on-disk segment size. */
95 .sdata : {
96 *(.sdata)
97 }
98
99 . = ALIGN(_PAGE_SIZE);
100 .data_nosave : {
101 __nosave_begin = .;
102 *(.data.nosave)
103 }
104 . = ALIGN(_PAGE_SIZE);
105 __nosave_end = .;
106
2dbac102 107 . = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
0f5c9064
SR
108 .data.cacheline_aligned : {
109 *(.data.cacheline_aligned)
110 }
111 _edata = .; /* End of data section */
112
113 /* will be freed after init */
114 . = ALIGN(_PAGE_SIZE); /* Init code and data */
115 __init_begin = .;
116 .init.text : {
117 _sinittext = .;
01ba2bdc 118 INIT_TEXT
0f5c9064
SR
119 _einittext = .;
120 }
121 .init.data : {
01ba2bdc 122 INIT_DATA
0f5c9064
SR
123 }
124 . = ALIGN(16);
125 .init.setup : {
126 __setup_start = .;
127 *(.init.setup)
128 __setup_end = .;
129 }
130
131 .initcall.init : {
132 __initcall_start = .;
133 INITCALLS
134 __initcall_end = .;
135 }
136
137 .con_initcall.init : {
138 __con_initcall_start = .;
139 *(.con_initcall.init)
140 __con_initcall_end = .;
141 }
142 SECURITY_INIT
143
144 /* .exit.text is discarded at runtime, not link time, to deal with
145 * references from .rodata
146 */
147 .exit.text : {
01ba2bdc 148 EXIT_TEXT
0f5c9064
SR
149 }
150 .exit.data : {
01ba2bdc 151 EXIT_DATA
0f5c9064 152 }
67d38229 153#if defined(CONFIG_BLK_DEV_INITRD)
0f5c9064
SR
154 . = ALIGN(_PAGE_SIZE);
155 .init.ramfs : {
156 __initramfs_start = .;
157 *(.init.ramfs)
158 __initramfs_end = .;
159 }
67d38229 160#endif
0f5c9064
SR
161 PERCPU(_PAGE_SIZE)
162 . = ALIGN(_PAGE_SIZE);
163 __init_end = .;
164 /* freed after init ends here */
165
166 __bss_start = .; /* BSS */
167 .sbss : {
168 *(.sbss)
169 *(.scommon)
170 }
171 .bss : {
172 *(.bss)
173 *(COMMON)
174 }
175 __bss_stop = .;
176
177 _end = . ;
178
179 /* Sections to be discarded */
180 /DISCARD/ : {
181 *(.exitcall.exit)
405d967d 182 *(.discard)
0f5c9064
SR
183
184 /* ABI crap starts here */
185 *(.MIPS.options)
186 *(.options)
187 *(.pdr)
188 *(.reginfo)
189 }
190
191 /* These mark the ABI of the kernel for debuggers. */
192 .mdebug.abi32 : {
193 KEEP(*(.mdebug.abi32))
194 }
195 .mdebug.abi64 : {
196 KEEP(*(.mdebug.abi64))
197 }
198
199 /* This is the MIPS specific mdebug section. */
200 .mdebug : {
201 *(.mdebug)
202 }
203
204 STABS_DEBUG
205 DWARF_DEBUG
206
207 /* These must appear regardless of . */
208 .gptab.sdata : {
209 *(.gptab.data)
210 *(.gptab.sdata)
211 }
212 .gptab.sbss : {
213 *(.gptab.bss)
214 *(.gptab.sbss)
215 }
1da177e4 216}
This page took 0.39276 seconds and 5 git commands to generate.