blob: 89853bcd27a658ac0aef934c61ba723057933457 [file] [log] [blame]
Tim Abbottc80d4712009-04-25 22:10:56 -04001#include <linux/section-names.h>
2
Linus Torvalds1da177e2005-04-16 15:20:36 -07003#ifndef LOAD_OFFSET
4#define LOAD_OFFSET 0
5#endif
6
7#ifndef VMLINUX_SYMBOL
8#define VMLINUX_SYMBOL(_sym_) _sym_
9#endif
10
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +000011/* Align . to a 8 byte boundary equals to maximum function alignment. */
12#define ALIGN_FUNCTION() . = ALIGN(8)
13
Sam Ravnborgeb8f6892008-01-20 20:07:28 +010014/* The actual configuration determine if the init/exit sections
15 * are handled as text/data or they can be discarded (which
16 * often happens at runtime)
17 */
18#ifdef CONFIG_HOTPLUG
19#define DEV_KEEP(sec) *(.dev##sec)
20#define DEV_DISCARD(sec)
21#else
22#define DEV_KEEP(sec)
23#define DEV_DISCARD(sec) *(.dev##sec)
24#endif
25
26#ifdef CONFIG_HOTPLUG_CPU
27#define CPU_KEEP(sec) *(.cpu##sec)
28#define CPU_DISCARD(sec)
29#else
30#define CPU_KEEP(sec)
31#define CPU_DISCARD(sec) *(.cpu##sec)
32#endif
33
Adrian Bunk1a3fb6d2008-01-24 22:20:18 +010034#if defined(CONFIG_MEMORY_HOTPLUG)
Sam Ravnborgeb8f6892008-01-20 20:07:28 +010035#define MEM_KEEP(sec) *(.mem##sec)
36#define MEM_DISCARD(sec)
37#else
38#define MEM_KEEP(sec)
39#define MEM_DISCARD(sec) *(.mem##sec)
40#endif
41
Steven Rostedt8da38212008-08-14 15:45:07 -040042#ifdef CONFIG_FTRACE_MCOUNT_RECORD
43#define MCOUNT_REC() VMLINUX_SYMBOL(__start_mcount_loc) = .; \
44 *(__mcount_loc) \
45 VMLINUX_SYMBOL(__stop_mcount_loc) = .;
46#else
47#define MCOUNT_REC()
48#endif
Sam Ravnborgeb8f6892008-01-20 20:07:28 +010049
Steven Rostedt2ed84ee2008-11-12 15:24:24 -050050#ifdef CONFIG_TRACE_BRANCH_PROFILING
Steven Rostedt45b79742008-11-21 00:40:40 -050051#define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \
52 *(_ftrace_annotated_branch) \
53 VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .;
Steven Rostedt1f0d69a2008-11-12 00:14:39 -050054#else
55#define LIKELY_PROFILE()
56#endif
57
Steven Rostedt2bcd5212008-11-21 01:30:54 -050058#ifdef CONFIG_PROFILE_ALL_BRANCHES
59#define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \
60 *(_ftrace_branch) \
61 VMLINUX_SYMBOL(__stop_branch_profile) = .;
62#else
63#define BRANCH_PROFILE()
64#endif
65
Steven Rostedtb77e38a2009-02-24 10:21:36 -050066#ifdef CONFIG_EVENT_TRACER
67#define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \
68 *(_ftrace_events) \
69 VMLINUX_SYMBOL(__stop_ftrace_events) = .;
70#else
71#define FTRACE_EVENTS()
72#endif
73
Lai Jiangshan1ba28e02009-03-06 17:21:48 +010074#ifdef CONFIG_TRACING
75#define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \
76 *(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \
77 VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .;
78#else
79#define TRACE_PRINTKS()
80#endif
81
Frederic Weisbeckerbed1ffc2009-03-13 15:42:11 +010082#ifdef CONFIG_FTRACE_SYSCALLS
83#define TRACE_SYSCALLS() VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \
84 *(__syscalls_metadata) \
85 VMLINUX_SYMBOL(__stop_syscalls_metadata) = .;
86#else
87#define TRACE_SYSCALLS()
88#endif
89
Sam Ravnborgca967252007-05-17 13:38:44 +020090/* .data section */
91#define DATA_DATA \
Sam Ravnborg0e0d3142007-05-17 20:14:48 +020092 *(.data) \
Sam Ravnborg312b1482008-01-28 20:21:15 +010093 *(.ref.data) \
Sam Ravnborgeb8f6892008-01-20 20:07:28 +010094 DEV_KEEP(init.data) \
95 DEV_KEEP(exit.data) \
96 CPU_KEEP(init.data) \
97 CPU_KEEP(exit.data) \
98 MEM_KEEP(init.data) \
99 MEM_KEEP(exit.data) \
Mathieu Desnoyers8256e472007-10-18 23:41:06 -0700100 . = ALIGN(8); \
101 VMLINUX_SYMBOL(__start___markers) = .; \
102 *(__markers) \
Mathieu Desnoyers97e1c182008-07-18 12:16:16 -0400103 VMLINUX_SYMBOL(__stop___markers) = .; \
Mathieu Desnoyers7e066fb2008-11-14 17:47:47 -0500104 . = ALIGN(32); \
Mathieu Desnoyers97e1c182008-07-18 12:16:16 -0400105 VMLINUX_SYMBOL(__start___tracepoints) = .; \
106 *(__tracepoints) \
Steven Rostedt1f0d69a2008-11-12 00:14:39 -0500107 VMLINUX_SYMBOL(__stop___tracepoints) = .; \
Jason Barone9d376f2009-02-05 11:51:38 -0500108 /* implement dynamic printk debug */ \
109 . = ALIGN(8); \
110 VMLINUX_SYMBOL(__start___verbose) = .; \
111 *(__verbose) \
112 VMLINUX_SYMBOL(__stop___verbose) = .; \
Steven Rostedt2bcd5212008-11-21 01:30:54 -0500113 LIKELY_PROFILE() \
Steven Rostedtb77e38a2009-02-24 10:21:36 -0500114 BRANCH_PROFILE() \
Ingo Molnar8a20d842009-03-09 10:09:06 +0100115 TRACE_PRINTKS() \
Frederic Weisbeckerbed1ffc2009-03-13 15:42:11 +0100116 FTRACE_EVENTS() \
117 TRACE_SYSCALLS()
Sam Ravnborgca967252007-05-17 13:38:44 +0200118
Sam Ravnborg4096b462007-05-29 21:29:00 +0200119#define RO_DATA(align) \
120 . = ALIGN((align)); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
Vivek Goyal65695802006-12-07 02:14:03 +0100122 VMLINUX_SYMBOL(__start_rodata) = .; \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 *(.rodata) *(.rodata.*) \
124 *(__vermagic) /* Kernel version magic */ \
Mathieu Desnoyers8256e472007-10-18 23:41:06 -0700125 *(__markers_strings) /* Markers: strings */ \
Mathieu Desnoyers97e1c182008-07-18 12:16:16 -0400126 *(__tracepoints_strings)/* Tracepoints: strings */ \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127 } \
128 \
129 .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \
130 *(.rodata1) \
131 } \
132 \
Jan Beulich6360b1f2008-05-12 15:44:41 +0200133 BUG_TABLE \
134 \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 /* PCI quirks */ \
136 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
137 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
138 *(.pci_fixup_early) \
139 VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \
140 VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \
141 *(.pci_fixup_header) \
142 VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \
143 VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
144 *(.pci_fixup_final) \
145 VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \
146 VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
147 *(.pci_fixup_enable) \
148 VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
Alan Cox1597cac2006-12-04 15:14:45 -0800149 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
150 *(.pci_fixup_resume) \
151 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
Rafael J. Wysockie1a2a512008-05-15 21:51:31 +0200152 VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \
153 *(.pci_fixup_resume_early) \
154 VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \
155 VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \
156 *(.pci_fixup_suspend) \
157 VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158 } \
159 \
David Woodhouse5658c762008-05-23 13:52:42 +0100160 /* Built-in firmware blobs */ \
161 .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \
162 VMLINUX_SYMBOL(__start_builtin_fw) = .; \
163 *(.builtin_fw) \
164 VMLINUX_SYMBOL(__end_builtin_fw) = .; \
165 } \
166 \
Matt Porter394b7012005-11-07 01:00:15 -0800167 /* RapidIO route ops */ \
168 .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \
169 VMLINUX_SYMBOL(__start_rio_route_ops) = .; \
170 *(.rio_route_ops) \
171 VMLINUX_SYMBOL(__end_rio_route_ops) = .; \
172 } \
173 \
Jan Beulich63687a52008-05-12 15:44:41 +0200174 TRACEDATA \
175 \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176 /* Kernel symbol table: Normal symbols */ \
177 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
178 VMLINUX_SYMBOL(__start___ksymtab) = .; \
179 *(__ksymtab) \
180 VMLINUX_SYMBOL(__stop___ksymtab) = .; \
181 } \
182 \
183 /* Kernel symbol table: GPL-only symbols */ \
184 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
185 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \
186 *(__ksymtab_gpl) \
187 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
188 } \
189 \
Arjan van de Venf71d20e2006-06-28 04:26:45 -0700190 /* Kernel symbol table: Normal unused symbols */ \
191 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
192 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
193 *(__ksymtab_unused) \
194 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
195 } \
196 \
197 /* Kernel symbol table: GPL-only unused symbols */ \
198 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
199 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
200 *(__ksymtab_unused_gpl) \
201 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
202 } \
203 \
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800204 /* Kernel symbol table: GPL-future-only symbols */ \
205 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
206 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
207 *(__ksymtab_gpl_future) \
208 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \
209 } \
210 \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 /* Kernel symbol table: Normal symbols */ \
212 __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \
213 VMLINUX_SYMBOL(__start___kcrctab) = .; \
214 *(__kcrctab) \
215 VMLINUX_SYMBOL(__stop___kcrctab) = .; \
216 } \
217 \
218 /* Kernel symbol table: GPL-only symbols */ \
219 __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \
220 VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \
221 *(__kcrctab_gpl) \
222 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \
223 } \
224 \
Arjan van de Venf71d20e2006-06-28 04:26:45 -0700225 /* Kernel symbol table: Normal unused symbols */ \
226 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \
227 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \
228 *(__kcrctab_unused) \
229 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \
230 } \
231 \
232 /* Kernel symbol table: GPL-only unused symbols */ \
233 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
234 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \
235 *(__kcrctab_unused_gpl) \
236 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \
237 } \
238 \
Greg Kroah-Hartman9f28bb72006-03-20 13:17:13 -0800239 /* Kernel symbol table: GPL-future-only symbols */ \
240 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
241 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \
242 *(__kcrctab_gpl_future) \
243 VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \
244 } \
245 \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 /* Kernel symbol table: strings */ \
247 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
248 *(__ksymtab_strings) \
249 } \
250 \
Sam Ravnborgeb8f6892008-01-20 20:07:28 +0100251 /* __*init sections */ \
252 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
Sam Ravnborg312b1482008-01-28 20:21:15 +0100253 *(.ref.rodata) \
Steven Rostedt8da38212008-08-14 15:45:07 -0400254 MCOUNT_REC() \
Sam Ravnborgeb8f6892008-01-20 20:07:28 +0100255 DEV_KEEP(init.rodata) \
256 DEV_KEEP(exit.rodata) \
257 CPU_KEEP(init.rodata) \
258 CPU_KEEP(exit.rodata) \
259 MEM_KEEP(init.rodata) \
260 MEM_KEEP(exit.rodata) \
261 } \
262 \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263 /* Built-in module parameters. */ \
264 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
265 VMLINUX_SYMBOL(__start___param) = .; \
266 *(__param) \
267 VMLINUX_SYMBOL(__stop___param) = .; \
Arjan van de Venedeed302008-01-30 13:34:08 +0100268 . = ALIGN((align)); \
Vivek Goyal65695802006-12-07 02:14:03 +0100269 VMLINUX_SYMBOL(__end_rodata) = .; \
Marcelo Tosatti7583ddf2006-09-27 01:51:02 -0700270 } \
Sam Ravnborg4096b462007-05-29 21:29:00 +0200271 . = ALIGN((align));
272
273/* RODATA provided for backward compatibility.
274 * All archs are supposed to use RO_DATA() */
275#define RODATA RO_DATA(4096)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276
277#define SECURITY_INIT \
Eric W. Biederman60bad7f2005-06-25 14:57:46 -0700278 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279 VMLINUX_SYMBOL(__security_initcall_start) = .; \
280 *(.security_initcall.init) \
281 VMLINUX_SYMBOL(__security_initcall_end) = .; \
282 }
283
Sam Ravnborg76647092007-05-13 00:31:33 +0200284/* .text section. Map to function alignment to avoid address changes
285 * during second ld run in second ld pass when generating System.map */
286#define TEXT_TEXT \
287 ALIGN_FUNCTION(); \
Jan Beulichfb5e2b32008-06-18 12:36:01 +0100288 *(.text.hot) \
Sam Ravnborg0e0d3142007-05-17 20:14:48 +0200289 *(.text) \
Sam Ravnborg312b1482008-01-28 20:21:15 +0100290 *(.ref.text) \
Sam Ravnborgeb8f6892008-01-20 20:07:28 +0100291 DEV_KEEP(init.text) \
292 DEV_KEEP(exit.text) \
293 CPU_KEEP(init.text) \
294 CPU_KEEP(exit.text) \
295 MEM_KEEP(init.text) \
Jan Beulichfb5e2b32008-06-18 12:36:01 +0100296 MEM_KEEP(exit.text) \
297 *(.text.unlikely)
Sam Ravnborgeb8f6892008-01-20 20:07:28 +0100298
Sam Ravnborg76647092007-05-13 00:31:33 +0200299
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000300/* sched.text is aling to function alignment to secure we have same
301 * address even at second ld pass when generating System.map */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302#define SCHED_TEXT \
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000303 ALIGN_FUNCTION(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304 VMLINUX_SYMBOL(__sched_text_start) = .; \
305 *(.sched.text) \
306 VMLINUX_SYMBOL(__sched_text_end) = .;
307
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000308/* spinlock.text is aling to function alignment to secure we have same
309 * address even at second ld pass when generating System.map */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310#define LOCK_TEXT \
Sam Ravnborg6d30e3a2005-07-14 20:15:44 +0000311 ALIGN_FUNCTION(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312 VMLINUX_SYMBOL(__lock_text_start) = .; \
313 *(.spinlock.text) \
314 VMLINUX_SYMBOL(__lock_text_end) = .;
Prasanna S Panchamukhid0aaff92005-09-06 15:19:26 -0700315
316#define KPROBES_TEXT \
317 ALIGN_FUNCTION(); \
318 VMLINUX_SYMBOL(__kprobes_text_start) = .; \
319 *(.kprobes.text) \
320 VMLINUX_SYMBOL(__kprobes_text_end) = .;
Paolo 'Blaisorblade' Giarrussoa7d0c212005-09-10 19:44:54 +0200321
Frederic Weisbeckera0343e82008-12-09 23:53:16 +0100322#ifdef CONFIG_FUNCTION_GRAPH_TRACER
323#define IRQENTRY_TEXT \
324 ALIGN_FUNCTION(); \
325 VMLINUX_SYMBOL(__irqentry_text_start) = .; \
326 *(.irqentry.text) \
327 VMLINUX_SYMBOL(__irqentry_text_end) = .;
328#else
329#define IRQENTRY_TEXT
330#endif
331
Sam Ravnborg37c514e2008-02-19 21:00:18 +0100332/* Section used for early init (in .S files) */
Tim Abbottc80d4712009-04-25 22:10:56 -0400333#define HEAD_TEXT *(HEAD_TEXT_SECTION)
Sam Ravnborg37c514e2008-02-19 21:00:18 +0100334
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100335/* init and exit section handling */
Sam Ravnborgeb8f6892008-01-20 20:07:28 +0100336#define INIT_DATA \
337 *(.init.data) \
338 DEV_DISCARD(init.data) \
339 DEV_DISCARD(init.rodata) \
340 CPU_DISCARD(init.data) \
341 CPU_DISCARD(init.rodata) \
342 MEM_DISCARD(init.data) \
Jason Barone9d376f2009-02-05 11:51:38 -0500343 MEM_DISCARD(init.rodata)
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100344
Sam Ravnborgeb8f6892008-01-20 20:07:28 +0100345#define INIT_TEXT \
346 *(.init.text) \
347 DEV_DISCARD(init.text) \
348 CPU_DISCARD(init.text) \
349 MEM_DISCARD(init.text)
350
351#define EXIT_DATA \
352 *(.exit.data) \
353 DEV_DISCARD(exit.data) \
354 DEV_DISCARD(exit.rodata) \
355 CPU_DISCARD(exit.data) \
356 CPU_DISCARD(exit.rodata) \
357 MEM_DISCARD(exit.data) \
358 MEM_DISCARD(exit.rodata)
359
360#define EXIT_TEXT \
361 *(.exit.text) \
362 DEV_DISCARD(exit.text) \
363 CPU_DISCARD(exit.text) \
364 MEM_DISCARD(exit.text)
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100365
Paolo 'Blaisorblade' Giarrussoa7d0c212005-09-10 19:44:54 +0200366 /* DWARF debug sections.
367 Symbols in the DWARF debugging sections are relative to
368 the beginning of the section so we begin them at 0. */
369#define DWARF_DEBUG \
370 /* DWARF 1 */ \
371 .debug 0 : { *(.debug) } \
372 .line 0 : { *(.line) } \
373 /* GNU DWARF 1 extensions */ \
374 .debug_srcinfo 0 : { *(.debug_srcinfo) } \
375 .debug_sfnames 0 : { *(.debug_sfnames) } \
376 /* DWARF 1.1 and DWARF 2 */ \
377 .debug_aranges 0 : { *(.debug_aranges) } \
378 .debug_pubnames 0 : { *(.debug_pubnames) } \
379 /* DWARF 2 */ \
380 .debug_info 0 : { *(.debug_info \
381 .gnu.linkonce.wi.*) } \
382 .debug_abbrev 0 : { *(.debug_abbrev) } \
383 .debug_line 0 : { *(.debug_line) } \
384 .debug_frame 0 : { *(.debug_frame) } \
385 .debug_str 0 : { *(.debug_str) } \
386 .debug_loc 0 : { *(.debug_loc) } \
387 .debug_macinfo 0 : { *(.debug_macinfo) } \
388 /* SGI/MIPS DWARF 2 extensions */ \
389 .debug_weaknames 0 : { *(.debug_weaknames) } \
390 .debug_funcnames 0 : { *(.debug_funcnames) } \
391 .debug_typenames 0 : { *(.debug_typenames) } \
392 .debug_varnames 0 : { *(.debug_varnames) } \
393
394 /* Stabs debugging sections. */
395#define STABS_DEBUG \
396 .stab 0 : { *(.stab) } \
397 .stabstr 0 : { *(.stabstr) } \
398 .stab.excl 0 : { *(.stab.excl) } \
399 .stab.exclstr 0 : { *(.stab.exclstr) } \
400 .stab.index 0 : { *(.stab.index) } \
401 .stab.indexstr 0 : { *(.stab.indexstr) } \
402 .comment 0 : { *(.comment) }
Jeremy Fitzhardinge9c9b8b32006-09-25 23:32:26 -0700403
Jan Beulich6360b1f2008-05-12 15:44:41 +0200404#ifdef CONFIG_GENERIC_BUG
Jeremy Fitzhardinge7664c5a2006-12-08 02:36:19 -0800405#define BUG_TABLE \
406 . = ALIGN(8); \
407 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
Yoshinori Satoc6de00262008-07-31 00:07:29 -0700408 VMLINUX_SYMBOL(__start___bug_table) = .; \
Jeremy Fitzhardinge7664c5a2006-12-08 02:36:19 -0800409 *(__bug_table) \
Yoshinori Satoc6de00262008-07-31 00:07:29 -0700410 VMLINUX_SYMBOL(__stop___bug_table) = .; \
Jeremy Fitzhardinge7664c5a2006-12-08 02:36:19 -0800411 }
Jan Beulich6360b1f2008-05-12 15:44:41 +0200412#else
413#define BUG_TABLE
414#endif
Jeremy Fitzhardinge7664c5a2006-12-08 02:36:19 -0800415
Jan Beulich63687a52008-05-12 15:44:41 +0200416#ifdef CONFIG_PM_TRACE
417#define TRACEDATA \
418 . = ALIGN(4); \
419 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \
Yoshinori Satoc6de00262008-07-31 00:07:29 -0700420 VMLINUX_SYMBOL(__tracedata_start) = .; \
Jan Beulich63687a52008-05-12 15:44:41 +0200421 *(.tracedata) \
Yoshinori Satoc6de00262008-07-31 00:07:29 -0700422 VMLINUX_SYMBOL(__tracedata_end) = .; \
Jan Beulich63687a52008-05-12 15:44:41 +0200423 }
424#else
425#define TRACEDATA
426#endif
427
Jeremy Fitzhardinge9c9b8b32006-09-25 23:32:26 -0700428#define NOTES \
Roland McGrathcbe87122007-07-19 01:48:36 -0700429 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
430 VMLINUX_SYMBOL(__start_notes) = .; \
431 *(.note.*) \
432 VMLINUX_SYMBOL(__stop_notes) = .; \
433 }
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700434
435#define INITCALLS \
Eduard - Gabriel Munteanuc2147a52008-07-25 19:45:11 -0700436 *(.initcallearly.init) \
Yoshinori Satoc6de00262008-07-31 00:07:29 -0700437 VMLINUX_SYMBOL(__early_initcall_end) = .; \
Linus Torvaldsb3438f82006-11-20 11:47:18 -0800438 *(.initcall0.init) \
439 *(.initcall0s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700440 *(.initcall1.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700441 *(.initcall1s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700442 *(.initcall2.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700443 *(.initcall2s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700444 *(.initcall3.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700445 *(.initcall3s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700446 *(.initcall4.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700447 *(.initcall4s.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700448 *(.initcall5.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700449 *(.initcall5s.init) \
Linus Torvalds8d610dd2006-12-11 12:12:04 -0800450 *(.initcallrootfs.init) \
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700451 *(.initcall6.init) \
Andrew Morton735a7ff2006-10-27 11:42:37 -0700452 *(.initcall6s.init) \
453 *(.initcall7.init) \
454 *(.initcall7s.init)
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700455
Tejun Heo3e5d8f92009-01-13 20:41:35 +0900456/**
Tejun Heo6b7c38d2009-01-19 12:21:28 +0900457 * PERCPU_VADDR - define output section for percpu area
Tejun Heo3e5d8f92009-01-13 20:41:35 +0900458 * @vaddr: explicit base address (optional)
459 * @phdr: destination PHDR (optional)
460 *
461 * Macro which expands to output section for percpu area. If @vaddr
462 * is not blank, it specifies explicit base address and all percpu
463 * symbols will be offset from the given address. If blank, @vaddr
464 * always equals @laddr + LOAD_OFFSET.
465 *
466 * @phdr defines the output PHDR to use if not blank. Be warned that
467 * output PHDR is sticky. If @phdr is specified, the next output
468 * section in the linker script will go there too. @phdr should have
469 * a leading colon.
470 *
Tejun Heo3ac6cff2009-01-30 16:32:22 +0900471 * Note that this macros defines __per_cpu_load as an absolute symbol.
472 * If there is no need to put the percpu section at a predetermined
473 * address, use PERCPU().
Tejun Heo3e5d8f92009-01-13 20:41:35 +0900474 */
475#define PERCPU_VADDR(vaddr, phdr) \
Ingo Molnardba3d362009-01-29 17:10:12 +0100476 VMLINUX_SYMBOL(__per_cpu_load) = .; \
477 .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
Tejun Heo6b7c38d2009-01-19 12:21:28 +0900478 - LOAD_OFFSET) { \
479 VMLINUX_SYMBOL(__per_cpu_start) = .; \
Brian Gerst0bd74fa2009-01-19 12:21:27 +0900480 *(.data.percpu.first) \
Eric Dumazet63cc8c72008-05-12 15:44:40 +0200481 *(.data.percpu.page_aligned) \
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700482 *(.data.percpu) \
483 *(.data.percpu.shared_aligned) \
Tejun Heo6b7c38d2009-01-19 12:21:28 +0900484 VMLINUX_SYMBOL(__per_cpu_end) = .; \
485 } phdr \
Ingo Molnardba3d362009-01-29 17:10:12 +0100486 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu);
Tejun Heo3e5d8f92009-01-13 20:41:35 +0900487
488/**
489 * PERCPU - define output section for percpu area, simple version
490 * @align: required alignment
491 *
492 * Align to @align and outputs output section for percpu area. This
493 * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and
494 * __per_cpu_start will be identical.
Tejun Heo3ac6cff2009-01-30 16:32:22 +0900495 *
496 * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except
497 * that __per_cpu_load is defined as a relative symbol against
498 * .data.percpu which is required for relocatable x86_32
499 * configuration.
Tejun Heo3e5d8f92009-01-13 20:41:35 +0900500 */
501#define PERCPU(align) \
502 . = ALIGN(align); \
Tejun Heo3ac6cff2009-01-30 16:32:22 +0900503 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
504 VMLINUX_SYMBOL(__per_cpu_load) = .; \
505 VMLINUX_SYMBOL(__per_cpu_start) = .; \
506 *(.data.percpu.first) \
507 *(.data.percpu.page_aligned) \
508 *(.data.percpu) \
509 *(.data.percpu.shared_aligned) \
510 VMLINUX_SYMBOL(__per_cpu_end) = .; \
511 }