6 #define VMLINUX_SYMBOL(_sym_) _sym_
9 /* Align . to a 8 byte boundary equals to maximum function alignment. */
10 #define ALIGN_FUNCTION() . = ALIGN(8)
12 /* The actual configuration determine if the init/exit sections
13 * are handled as text/data or they can be discarded (which
14 * often happens at runtime)
17 #define DEV_KEEP(sec) *(.dev##sec)
18 #define DEV_DISCARD(sec)
21 #define DEV_DISCARD(sec) *(.dev##sec)
24 #ifdef CONFIG_HOTPLUG_CPU
25 #define CPU_KEEP(sec) *(.cpu##sec)
26 #define CPU_DISCARD(sec)
29 #define CPU_DISCARD(sec) *(.cpu##sec)
32 #if defined(CONFIG_MEMORY_HOTPLUG)
33 #define MEM_KEEP(sec) *(.mem##sec)
34 #define MEM_DISCARD(sec)
37 #define MEM_DISCARD(sec) *(.mem##sec)
40 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
41 #define MCOUNT_REC() VMLINUX_SYMBOL(__start_mcount_loc) = .; \
43 VMLINUX_SYMBOL(__stop_mcount_loc) = .;
48 #ifdef CONFIG_TRACE_BRANCH_PROFILING
49 #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \
50 *(_ftrace_annotated_branch) \
51 VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .;
53 #define LIKELY_PROFILE()
56 #ifdef CONFIG_PROFILE_ALL_BRANCHES
57 #define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \
59 VMLINUX_SYMBOL(__stop_branch_profile) = .;
61 #define BRANCH_PROFILE()
76 VMLINUX_SYMBOL(__start___markers) = .; \
78 VMLINUX_SYMBOL(__stop___markers) = .; \
80 VMLINUX_SYMBOL(__start___tracepoints) = .; \
82 VMLINUX_SYMBOL(__stop___tracepoints) = .; \
86 #define RO_DATA(align) \
88 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
89 VMLINUX_SYMBOL(__start_rodata) = .; \
90 *(.rodata) *(.rodata.*) \
91 *(__vermagic) /* Kernel version magic */ \
92 *(__markers_strings) /* Markers: strings */ \
93 *(__tracepoints_strings)/* Tracepoints: strings */ \
96 .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \
103 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
104 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
105 *(.pci_fixup_early) \
106 VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \
107 VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \
108 *(.pci_fixup_header) \
109 VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \
110 VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
111 *(.pci_fixup_final) \
112 VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \
113 VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
114 *(.pci_fixup_enable) \
115 VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
116 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
117 *(.pci_fixup_resume) \
118 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
119 VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \
120 *(.pci_fixup_resume_early) \
121 VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \
122 VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \
123 *(.pci_fixup_suspend) \
124 VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \
127 /* Built-in firmware blobs */ \
128 .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \
129 VMLINUX_SYMBOL(__start_builtin_fw) = .; \
131 VMLINUX_SYMBOL(__end_builtin_fw) = .; \
134 /* RapidIO route ops */ \
135 .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \
136 VMLINUX_SYMBOL(__start_rio_route_ops) = .; \
138 VMLINUX_SYMBOL(__end_rio_route_ops) = .; \
143 /* Kernel symbol table: Normal symbols */ \
144 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
145 VMLINUX_SYMBOL(__start___ksymtab) = .; \
147 VMLINUX_SYMBOL(__stop___ksymtab) = .; \
150 /* Kernel symbol table: GPL-only symbols */ \
151 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
152 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \
154 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
157 /* Kernel symbol table: Normal unused symbols */ \
158 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
159 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
160 *(__ksymtab_unused) \
161 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
164 /* Kernel symbol table: GPL-only unused symbols */ \
165 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
166 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
167 *(__ksymtab_unused_gpl) \
168 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
171 /* Kernel symbol table: GPL-future-only symbols */ \
172 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
173 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
174 *(__ksymtab_gpl_future) \
175 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \
178 /* Kernel symbol table: Normal symbols */ \
179 __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \
180 VMLINUX_SYMBOL(__start___kcrctab) = .; \
182 VMLINUX_SYMBOL(__stop___kcrctab) = .; \
185 /* Kernel symbol table: GPL-only symbols */ \
186 __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \
187 VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \
189 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \
192 /* Kernel symbol table: Normal unused symbols */ \
193 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \
194 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \
195 *(__kcrctab_unused) \
196 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \
199 /* Kernel symbol table: GPL-only unused symbols */ \
200 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
201 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \
202 *(__kcrctab_unused_gpl) \
203 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \
206 /* Kernel symbol table: GPL-future-only symbols */ \
207 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
208 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \
209 *(__kcrctab_gpl_future) \
210 VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \
213 /* Kernel symbol table: strings */ \
214 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
215 *(__ksymtab_strings) \
218 /* __*init sections */ \
219 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
222 DEV_KEEP(init.rodata) \
223 DEV_KEEP(exit.rodata) \
224 CPU_KEEP(init.rodata) \
225 CPU_KEEP(exit.rodata) \
226 MEM_KEEP(init.rodata) \
227 MEM_KEEP(exit.rodata) \
230 /* Built-in module parameters. */ \
231 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
232 VMLINUX_SYMBOL(__start___param) = .; \
234 VMLINUX_SYMBOL(__stop___param) = .; \
235 . = ALIGN((align)); \
236 VMLINUX_SYMBOL(__end_rodata) = .; \
240 /* RODATA provided for backward compatibility.
241 * All archs are supposed to use RO_DATA() */
242 #define RODATA RO_DATA(4096)
244 #define SECURITY_INIT \
245 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
246 VMLINUX_SYMBOL(__security_initcall_start) = .; \
247 *(.security_initcall.init) \
248 VMLINUX_SYMBOL(__security_initcall_end) = .; \
251 /* .text section. Map to function alignment to avoid address changes
252 * during second ld run in second ld pass when generating System.map */
258 *(.text.init.refok) \
259 *(.exit.text.refok) \
260 DEV_KEEP(init.text) \
261 DEV_KEEP(exit.text) \
262 CPU_KEEP(init.text) \
263 CPU_KEEP(exit.text) \
264 MEM_KEEP(init.text) \
265 MEM_KEEP(exit.text) \
269 /* sched.text is aling to function alignment to secure we have same
270 * address even at second ld pass when generating System.map */
273 VMLINUX_SYMBOL(__sched_text_start) = .; \
275 VMLINUX_SYMBOL(__sched_text_end) = .;
277 /* spinlock.text is aling to function alignment to secure we have same
278 * address even at second ld pass when generating System.map */
281 VMLINUX_SYMBOL(__lock_text_start) = .; \
283 VMLINUX_SYMBOL(__lock_text_end) = .;
285 #define KPROBES_TEXT \
287 VMLINUX_SYMBOL(__kprobes_text_start) = .; \
289 VMLINUX_SYMBOL(__kprobes_text_end) = .;
291 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
292 #define IRQENTRY_TEXT \
294 VMLINUX_SYMBOL(__irqentry_text_start) = .; \
296 VMLINUX_SYMBOL(__irqentry_text_end) = .;
298 #define IRQENTRY_TEXT
301 /* Section used for early init (in .S files) */
302 #define HEAD_TEXT *(.head.text)
304 /* init and exit section handling */
307 DEV_DISCARD(init.data) \
308 DEV_DISCARD(init.rodata) \
309 CPU_DISCARD(init.data) \
310 CPU_DISCARD(init.rodata) \
311 MEM_DISCARD(init.data) \
312 MEM_DISCARD(init.rodata) \
313 /* implement dynamic printk debug */ \
314 VMLINUX_SYMBOL(__start___verbose_strings) = .; \
315 *(__verbose_strings) \
316 VMLINUX_SYMBOL(__stop___verbose_strings) = .; \
318 VMLINUX_SYMBOL(__start___verbose) = .; \
320 VMLINUX_SYMBOL(__stop___verbose) = .;
324 DEV_DISCARD(init.text) \
325 CPU_DISCARD(init.text) \
326 MEM_DISCARD(init.text)
330 DEV_DISCARD(exit.data) \
331 DEV_DISCARD(exit.rodata) \
332 CPU_DISCARD(exit.data) \
333 CPU_DISCARD(exit.rodata) \
334 MEM_DISCARD(exit.data) \
335 MEM_DISCARD(exit.rodata)
339 DEV_DISCARD(exit.text) \
340 CPU_DISCARD(exit.text) \
341 MEM_DISCARD(exit.text)
343 /* DWARF debug sections.
344 Symbols in the DWARF debugging sections are relative to
345 the beginning of the section so we begin them at 0. */
346 #define DWARF_DEBUG \
348 .debug 0 : { *(.debug) } \
349 .line 0 : { *(.line) } \
350 /* GNU DWARF 1 extensions */ \
351 .debug_srcinfo 0 : { *(.debug_srcinfo) } \
352 .debug_sfnames 0 : { *(.debug_sfnames) } \
353 /* DWARF 1.1 and DWARF 2 */ \
354 .debug_aranges 0 : { *(.debug_aranges) } \
355 .debug_pubnames 0 : { *(.debug_pubnames) } \
357 .debug_info 0 : { *(.debug_info \
358 .gnu.linkonce.wi.*) } \
359 .debug_abbrev 0 : { *(.debug_abbrev) } \
360 .debug_line 0 : { *(.debug_line) } \
361 .debug_frame 0 : { *(.debug_frame) } \
362 .debug_str 0 : { *(.debug_str) } \
363 .debug_loc 0 : { *(.debug_loc) } \
364 .debug_macinfo 0 : { *(.debug_macinfo) } \
365 /* SGI/MIPS DWARF 2 extensions */ \
366 .debug_weaknames 0 : { *(.debug_weaknames) } \
367 .debug_funcnames 0 : { *(.debug_funcnames) } \
368 .debug_typenames 0 : { *(.debug_typenames) } \
369 .debug_varnames 0 : { *(.debug_varnames) } \
371 /* Stabs debugging sections. */
372 #define STABS_DEBUG \
373 .stab 0 : { *(.stab) } \
374 .stabstr 0 : { *(.stabstr) } \
375 .stab.excl 0 : { *(.stab.excl) } \
376 .stab.exclstr 0 : { *(.stab.exclstr) } \
377 .stab.index 0 : { *(.stab.index) } \
378 .stab.indexstr 0 : { *(.stab.indexstr) } \
379 .comment 0 : { *(.comment) }
381 #ifdef CONFIG_GENERIC_BUG
384 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
385 VMLINUX_SYMBOL(__start___bug_table) = .; \
387 VMLINUX_SYMBOL(__stop___bug_table) = .; \
393 #ifdef CONFIG_PM_TRACE
396 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \
397 VMLINUX_SYMBOL(__tracedata_start) = .; \
399 VMLINUX_SYMBOL(__tracedata_end) = .; \
406 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
407 VMLINUX_SYMBOL(__start_notes) = .; \
409 VMLINUX_SYMBOL(__stop_notes) = .; \
413 *(.initcallearly.init) \
414 VMLINUX_SYMBOL(__early_initcall_end) = .; \
416 *(.initcall0s.init) \
418 *(.initcall1s.init) \
420 *(.initcall2s.init) \
422 *(.initcall3s.init) \
424 *(.initcall4s.init) \
426 *(.initcall5s.init) \
427 *(.initcallrootfs.init) \
429 *(.initcall6s.init) \
434 * PERCPU_VADDR - define output section for percpu area
435 * @vaddr: explicit base address (optional)
436 * @phdr: destination PHDR (optional)
438 * Macro which expands to output section for percpu area. If @vaddr
439 * is not blank, it specifies explicit base address and all percpu
440 * symbols will be offset from the given address. If blank, @vaddr
441 * always equals @laddr + LOAD_OFFSET.
443 * @phdr defines the output PHDR to use if not blank. Be warned that
444 * output PHDR is sticky. If @phdr is specified, the next output
445 * section in the linker script will go there too. @phdr should have
448 * Note that this macros defines __per_cpu_load as an absolute symbol.
449 * If there is no need to put the percpu section at a predetermined
450 * address, use PERCPU().
452 #define PERCPU_VADDR(vaddr, phdr) \
453 VMLINUX_SYMBOL(__per_cpu_load) = .; \
454 .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
456 VMLINUX_SYMBOL(__per_cpu_start) = .; \
457 *(.data.percpu.first) \
458 *(.data.percpu.page_aligned) \
460 *(.data.percpu.shared_aligned) \
461 VMLINUX_SYMBOL(__per_cpu_end) = .; \
463 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu);
466 * PERCPU - define output section for percpu area, simple version
467 * @align: required alignment
469 * Align to @align and outputs output section for percpu area. This
470 * macro doesn't maniuplate @vaddr or @phdr and __per_cpu_load and
471 * __per_cpu_start will be identical.
473 * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except
474 * that __per_cpu_load is defined as a relative symbol against
475 * .data.percpu which is required for relocatable x86_32
478 #define PERCPU(align) \
480 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
481 VMLINUX_SYMBOL(__per_cpu_load) = .; \
482 VMLINUX_SYMBOL(__per_cpu_start) = .; \
483 *(.data.percpu.first) \
484 *(.data.percpu.page_aligned) \
486 *(.data.percpu.shared_aligned) \
487 VMLINUX_SYMBOL(__per_cpu_end) = .; \