2 * Helper macros to support writing architecture specific
5 * A minimal linker scripts has following content:
6 * [This is a sample, architectures may have special requiriements]
16 * INIT_TEXT_SECTION(PAGE_SIZE)
17 * INIT_DATA_SECTION(...)
18 * PERCPU_SECTION(CACHELINE_SIZE)
26 * RO_DATA_SECTION(PAGE_SIZE)
27 * RW_DATA_SECTION(...)
30 * EXCEPTION_TABLE(...)
33 * BSS_SECTION(0, 0, 0)
39 * DISCARDS // must be the last
42 * [__init_begin, __init_end] is the init section that may be freed after init
43 * [_stext, _etext] is the text section
44 * [_sdata, _edata] is the data section
46 * Some of the included output section have their own set of constants.
47 * Examples are: [__initramfs_start, __initramfs_end] for initramfs and
48 * [__nosave_begin, __nosave_end] for the nosave data
55 #include <linux/export.h>
57 /* Align . to a 8 byte boundary equals to maximum function alignment. */
58 #define ALIGN_FUNCTION() . = ALIGN(8)
61 * Align to a 32 byte boundary equal to the
62 * alignment gcc 4.5 uses for a struct
64 #define STRUCT_ALIGNMENT 32
65 #define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT)
67 /* The actual configuration determine if the init/exit sections
68 * are handled as text/data or they can be discarded (which
69 * often happens at runtime)
71 #ifdef CONFIG_HOTPLUG_CPU
72 #define CPU_KEEP(sec) *(.cpu##sec)
73 #define CPU_DISCARD(sec)
76 #define CPU_DISCARD(sec) *(.cpu##sec)
79 #if defined(CONFIG_MEMORY_HOTPLUG)
80 #define MEM_KEEP(sec) *(.mem##sec)
81 #define MEM_DISCARD(sec)
84 #define MEM_DISCARD(sec) *(.mem##sec)
87 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
88 #define MCOUNT_REC() . = ALIGN(8); \
89 VMLINUX_SYMBOL(__start_mcount_loc) = .; \
91 VMLINUX_SYMBOL(__stop_mcount_loc) = .;
96 #ifdef CONFIG_TRACE_BRANCH_PROFILING
97 #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \
98 *(_ftrace_annotated_branch) \
99 VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .;
101 #define LIKELY_PROFILE()
104 #ifdef CONFIG_PROFILE_ALL_BRANCHES
105 #define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \
107 VMLINUX_SYMBOL(__stop_branch_profile) = .;
109 #define BRANCH_PROFILE()
112 #ifdef CONFIG_EVENT_TRACING
113 #define FTRACE_EVENTS() . = ALIGN(8); \
114 VMLINUX_SYMBOL(__start_ftrace_events) = .; \
116 VMLINUX_SYMBOL(__stop_ftrace_events) = .;
118 #define FTRACE_EVENTS()
121 #ifdef CONFIG_TRACING
122 #define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \
123 *(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \
124 VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .;
125 #define TRACEPOINT_STR() VMLINUX_SYMBOL(__start___tracepoint_str) = .; \
126 *(__tracepoint_str) /* Trace_printk fmt' pointer */ \
127 VMLINUX_SYMBOL(__stop___tracepoint_str) = .;
129 #define TRACE_PRINTKS()
130 #define TRACEPOINT_STR()
133 #ifdef CONFIG_FTRACE_SYSCALLS
134 #define TRACE_SYSCALLS() . = ALIGN(8); \
135 VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \
136 *(__syscalls_metadata) \
137 VMLINUX_SYMBOL(__stop_syscalls_metadata) = .;
139 #define TRACE_SYSCALLS()
142 #ifdef CONFIG_CLKSRC_OF
143 #define CLKSRC_OF_TABLES() . = ALIGN(8); \
144 VMLINUX_SYMBOL(__clksrc_of_table) = .; \
145 *(__clksrc_of_table) \
146 *(__clksrc_of_table_end)
148 #define CLKSRC_OF_TABLES()
151 #ifdef CONFIG_IRQCHIP
152 #define IRQCHIP_OF_MATCH_TABLE() \
154 VMLINUX_SYMBOL(__irqchip_begin) = .; \
155 *(__irqchip_of_table) \
158 #define IRQCHIP_OF_MATCH_TABLE()
161 #ifdef CONFIG_COMMON_CLK
162 #define CLK_OF_TABLES() . = ALIGN(8); \
163 VMLINUX_SYMBOL(__clk_of_table) = .; \
165 *(__clk_of_table_end)
167 #define CLK_OF_TABLES()
170 #ifdef CONFIG_OF_RESERVED_MEM
171 #define RESERVEDMEM_OF_TABLES() \
173 VMLINUX_SYMBOL(__reservedmem_of_table) = .; \
174 *(__reservedmem_of_table) \
175 *(__reservedmem_of_table_end)
177 #define RESERVEDMEM_OF_TABLES()
180 #define KERNEL_DTB() \
182 VMLINUX_SYMBOL(__dtb_start) = .; \
183 *(.dtb.init.rodata) \
184 VMLINUX_SYMBOL(__dtb_end) = .;
190 *(.data..shared_aligned) /* percpu related */ \
191 MEM_KEEP(init.data) \
192 MEM_KEEP(exit.data) \
196 /* implement dynamic printk debug */ \
198 VMLINUX_SYMBOL(__start___jump_table) = .; \
200 VMLINUX_SYMBOL(__stop___jump_table) = .; \
202 VMLINUX_SYMBOL(__start___verbose) = .; \
204 VMLINUX_SYMBOL(__stop___verbose) = .; \
211 * Data section helpers
213 #define NOSAVE_DATA \
214 . = ALIGN(PAGE_SIZE); \
215 VMLINUX_SYMBOL(__nosave_begin) = .; \
217 . = ALIGN(PAGE_SIZE); \
218 VMLINUX_SYMBOL(__nosave_end) = .;
220 #define PAGE_ALIGNED_DATA(page_align) \
221 . = ALIGN(page_align); \
222 *(.data..page_aligned)
224 #define READ_MOSTLY_DATA(align) \
226 *(.data..read_mostly) \
229 #define CACHELINE_ALIGNED_DATA(align) \
231 *(.data..cacheline_aligned)
233 #define INIT_TASK_DATA(align) \
240 #define RO_DATA_SECTION(align) \
241 . = ALIGN((align)); \
242 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
243 VMLINUX_SYMBOL(__start_rodata) = .; \
244 *(.rodata) *(.rodata.*) \
245 *(__vermagic) /* Kernel version magic */ \
247 VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \
248 *(__tracepoints_ptrs) /* Tracepoints: pointer array */\
249 VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \
250 *(__tracepoints_strings)/* Tracepoints: strings */ \
253 .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \
260 .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
261 VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
262 *(.pci_fixup_early) \
263 VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \
264 VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \
265 *(.pci_fixup_header) \
266 VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \
267 VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
268 *(.pci_fixup_final) \
269 VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \
270 VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
271 *(.pci_fixup_enable) \
272 VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
273 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
274 *(.pci_fixup_resume) \
275 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
276 VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \
277 *(.pci_fixup_resume_early) \
278 VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \
279 VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \
280 *(.pci_fixup_suspend) \
281 VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \
284 /* Built-in firmware blobs */ \
285 .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \
286 VMLINUX_SYMBOL(__start_builtin_fw) = .; \
288 VMLINUX_SYMBOL(__end_builtin_fw) = .; \
293 /* Kernel symbol table: Normal symbols */ \
294 __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
295 VMLINUX_SYMBOL(__start___ksymtab) = .; \
296 *(SORT(___ksymtab+*)) \
297 VMLINUX_SYMBOL(__stop___ksymtab) = .; \
300 /* Kernel symbol table: GPL-only symbols */ \
301 __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
302 VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \
303 *(SORT(___ksymtab_gpl+*)) \
304 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
307 /* Kernel symbol table: Normal unused symbols */ \
308 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
309 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
310 *(SORT(___ksymtab_unused+*)) \
311 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
314 /* Kernel symbol table: GPL-only unused symbols */ \
315 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
316 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
317 *(SORT(___ksymtab_unused_gpl+*)) \
318 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
321 /* Kernel symbol table: GPL-future-only symbols */ \
322 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
323 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
324 *(SORT(___ksymtab_gpl_future+*)) \
325 VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \
328 /* Kernel symbol table: Normal symbols */ \
329 __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \
330 VMLINUX_SYMBOL(__start___kcrctab) = .; \
331 *(SORT(___kcrctab+*)) \
332 VMLINUX_SYMBOL(__stop___kcrctab) = .; \
335 /* Kernel symbol table: GPL-only symbols */ \
336 __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \
337 VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \
338 *(SORT(___kcrctab_gpl+*)) \
339 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \
342 /* Kernel symbol table: Normal unused symbols */ \
343 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \
344 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \
345 *(SORT(___kcrctab_unused+*)) \
346 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \
349 /* Kernel symbol table: GPL-only unused symbols */ \
350 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
351 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \
352 *(SORT(___kcrctab_unused_gpl+*)) \
353 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \
356 /* Kernel symbol table: GPL-future-only symbols */ \
357 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
358 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \
359 *(SORT(___kcrctab_gpl_future+*)) \
360 VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \
363 /* Kernel symbol table: strings */ \
364 __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
365 *(__ksymtab_strings) \
368 /* __*init sections */ \
369 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
371 MEM_KEEP(init.rodata) \
372 MEM_KEEP(exit.rodata) \
375 /* Built-in module parameters. */ \
376 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
377 VMLINUX_SYMBOL(__start___param) = .; \
379 VMLINUX_SYMBOL(__stop___param) = .; \
382 /* Built-in module versions. */ \
383 __modver : AT(ADDR(__modver) - LOAD_OFFSET) { \
384 VMLINUX_SYMBOL(__start___modver) = .; \
386 VMLINUX_SYMBOL(__stop___modver) = .; \
387 . = ALIGN((align)); \
388 VMLINUX_SYMBOL(__end_rodata) = .; \
392 /* RODATA & RO_DATA provided for backward compatibility.
393 * All archs are supposed to use RO_DATA() */
394 #define RODATA RO_DATA_SECTION(4096)
395 #define RO_DATA(align) RO_DATA_SECTION(align)
397 #define SECURITY_INIT \
398 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
399 VMLINUX_SYMBOL(__security_initcall_start) = .; \
400 *(.security_initcall.init) \
401 VMLINUX_SYMBOL(__security_initcall_end) = .; \
404 /* .text section. Map to function alignment to avoid address changes
405 * during second ld run in second ld pass when generating System.map */
411 MEM_KEEP(init.text) \
412 MEM_KEEP(exit.text) \
416 /* sched.text is aling to function alignment to secure we have same
417 * address even at second ld pass when generating System.map */
420 VMLINUX_SYMBOL(__sched_text_start) = .; \
422 VMLINUX_SYMBOL(__sched_text_end) = .;
424 /* spinlock.text is aling to function alignment to secure we have same
425 * address even at second ld pass when generating System.map */
428 VMLINUX_SYMBOL(__lock_text_start) = .; \
430 VMLINUX_SYMBOL(__lock_text_end) = .;
432 #define KPROBES_TEXT \
434 VMLINUX_SYMBOL(__kprobes_text_start) = .; \
436 VMLINUX_SYMBOL(__kprobes_text_end) = .;
440 VMLINUX_SYMBOL(__entry_text_start) = .; \
442 VMLINUX_SYMBOL(__entry_text_end) = .;
444 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
445 #define IRQENTRY_TEXT \
447 VMLINUX_SYMBOL(__irqentry_text_start) = .; \
449 VMLINUX_SYMBOL(__irqentry_text_end) = .;
451 #define IRQENTRY_TEXT
454 /* Section used for early init (in .S files) */
455 #define HEAD_TEXT *(.head.text)
457 #define HEAD_TEXT_SECTION \
458 .head.text : AT(ADDR(.head.text) - LOAD_OFFSET) { \
465 #define EXCEPTION_TABLE(align) \
467 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \
468 VMLINUX_SYMBOL(__start___ex_table) = .; \
470 VMLINUX_SYMBOL(__stop___ex_table) = .; \
476 #define INIT_TASK_DATA_SECTION(align) \
478 .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) { \
479 INIT_TASK_DATA(align) \
482 #ifdef CONFIG_CONSTRUCTORS
483 #define KERNEL_CTORS() . = ALIGN(8); \
484 VMLINUX_SYMBOL(__ctors_start) = .; \
487 VMLINUX_SYMBOL(__ctors_end) = .;
489 #define KERNEL_CTORS()
492 /* init and exit section handling */
495 MEM_DISCARD(init.data) \
501 MEM_DISCARD(init.rodata) \
503 RESERVEDMEM_OF_TABLES() \
506 IRQCHIP_OF_MATCH_TABLE()
510 MEM_DISCARD(init.text)
514 MEM_DISCARD(exit.data) \
515 MEM_DISCARD(exit.rodata)
519 MEM_DISCARD(exit.text)
525 * bss (Block Started by Symbol) - uninitialized data
526 * zeroed during startup
528 #define SBSS(sbss_align) \
529 . = ALIGN(sbss_align); \
530 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \
536 * Allow archectures to redefine BSS_FIRST_SECTIONS to add extra
537 * sections to the front of bss.
539 #ifndef BSS_FIRST_SECTIONS
540 #define BSS_FIRST_SECTIONS
543 #define BSS(bss_align) \
544 . = ALIGN(bss_align); \
545 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \
547 *(.bss..page_aligned) \
554 * DWARF debug sections.
555 * Symbols in the DWARF debugging sections are relative to
556 * the beginning of the section so we begin them at 0.
558 #define DWARF_DEBUG \
560 .debug 0 : { *(.debug) } \
561 .line 0 : { *(.line) } \
562 /* GNU DWARF 1 extensions */ \
563 .debug_srcinfo 0 : { *(.debug_srcinfo) } \
564 .debug_sfnames 0 : { *(.debug_sfnames) } \
565 /* DWARF 1.1 and DWARF 2 */ \
566 .debug_aranges 0 : { *(.debug_aranges) } \
567 .debug_pubnames 0 : { *(.debug_pubnames) } \
569 .debug_info 0 : { *(.debug_info \
570 .gnu.linkonce.wi.*) } \
571 .debug_abbrev 0 : { *(.debug_abbrev) } \
572 .debug_line 0 : { *(.debug_line) } \
573 .debug_frame 0 : { *(.debug_frame) } \
574 .debug_str 0 : { *(.debug_str) } \
575 .debug_loc 0 : { *(.debug_loc) } \
576 .debug_macinfo 0 : { *(.debug_macinfo) } \
577 /* SGI/MIPS DWARF 2 extensions */ \
578 .debug_weaknames 0 : { *(.debug_weaknames) } \
579 .debug_funcnames 0 : { *(.debug_funcnames) } \
580 .debug_typenames 0 : { *(.debug_typenames) } \
581 .debug_varnames 0 : { *(.debug_varnames) } \
583 /* Stabs debugging sections. */
584 #define STABS_DEBUG \
585 .stab 0 : { *(.stab) } \
586 .stabstr 0 : { *(.stabstr) } \
587 .stab.excl 0 : { *(.stab.excl) } \
588 .stab.exclstr 0 : { *(.stab.exclstr) } \
589 .stab.index 0 : { *(.stab.index) } \
590 .stab.indexstr 0 : { *(.stab.indexstr) } \
591 .comment 0 : { *(.comment) }
593 #ifdef CONFIG_GENERIC_BUG
596 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
597 VMLINUX_SYMBOL(__start___bug_table) = .; \
599 VMLINUX_SYMBOL(__stop___bug_table) = .; \
605 #ifdef CONFIG_PM_TRACE
608 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \
609 VMLINUX_SYMBOL(__tracedata_start) = .; \
611 VMLINUX_SYMBOL(__tracedata_end) = .; \
618 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
619 VMLINUX_SYMBOL(__start_notes) = .; \
621 VMLINUX_SYMBOL(__stop_notes) = .; \
624 #define INIT_SETUP(initsetup_align) \
625 . = ALIGN(initsetup_align); \
626 VMLINUX_SYMBOL(__setup_start) = .; \
628 VMLINUX_SYMBOL(__setup_end) = .;
630 #define INIT_CALLS_LEVEL(level) \
631 VMLINUX_SYMBOL(__initcall##level##_start) = .; \
632 *(.initcall##level##.init) \
633 *(.initcall##level##s.init) \
636 VMLINUX_SYMBOL(__initcall_start) = .; \
637 *(.initcallearly.init) \
638 INIT_CALLS_LEVEL(0) \
639 INIT_CALLS_LEVEL(1) \
640 INIT_CALLS_LEVEL(2) \
641 INIT_CALLS_LEVEL(3) \
642 INIT_CALLS_LEVEL(4) \
643 INIT_CALLS_LEVEL(5) \
644 INIT_CALLS_LEVEL(rootfs) \
645 INIT_CALLS_LEVEL(6) \
646 INIT_CALLS_LEVEL(7) \
647 VMLINUX_SYMBOL(__initcall_end) = .;
649 #define CON_INITCALL \
650 VMLINUX_SYMBOL(__con_initcall_start) = .; \
651 *(.con_initcall.init) \
652 VMLINUX_SYMBOL(__con_initcall_end) = .;
654 #define SECURITY_INITCALL \
655 VMLINUX_SYMBOL(__security_initcall_start) = .; \
656 *(.security_initcall.init) \
657 VMLINUX_SYMBOL(__security_initcall_end) = .;
659 #ifdef CONFIG_BLK_DEV_INITRD
660 #define INIT_RAM_FS \
662 VMLINUX_SYMBOL(__initramfs_start) = .; \
671 * Default discarded sections.
673 * Some archs want to discard exit text/data at runtime rather than
674 * link time due to cross-section references such as alt instructions,
675 * bug table, eh_frame, etc. DISCARDS must be the last of output
676 * section definitions so that such archs put those in earlier section
689 * PERCPU_INPUT - the percpu input sections
690 * @cacheline: cacheline size
692 * The core percpu section names and core symbols which do not rely
693 * directly upon load addresses.
695 * @cacheline is used to align subsections to avoid false cacheline
696 * sharing between subsections for different purposes.
698 #define PERCPU_INPUT(cacheline) \
699 VMLINUX_SYMBOL(__per_cpu_start) = .; \
700 *(.data..percpu..first) \
701 . = ALIGN(PAGE_SIZE); \
702 *(.data..percpu..page_aligned) \
703 . = ALIGN(cacheline); \
704 *(.data..percpu..readmostly) \
705 . = ALIGN(cacheline); \
707 *(.data..percpu..shared_aligned) \
708 VMLINUX_SYMBOL(__per_cpu_end) = .;
711 * PERCPU_VADDR - define output section for percpu area
712 * @cacheline: cacheline size
713 * @vaddr: explicit base address (optional)
714 * @phdr: destination PHDR (optional)
716 * Macro which expands to output section for percpu area.
718 * @cacheline is used to align subsections to avoid false cacheline
719 * sharing between subsections for different purposes.
721 * If @vaddr is not blank, it specifies explicit base address and all
722 * percpu symbols will be offset from the given address. If blank,
723 * @vaddr always equals @laddr + LOAD_OFFSET.
725 * @phdr defines the output PHDR to use if not blank. Be warned that
726 * output PHDR is sticky. If @phdr is specified, the next output
727 * section in the linker script will go there too. @phdr should have
730 * Note that this macros defines __per_cpu_load as an absolute symbol.
731 * If there is no need to put the percpu section at a predetermined
732 * address, use PERCPU_SECTION.
734 #define PERCPU_VADDR(cacheline, vaddr, phdr) \
735 VMLINUX_SYMBOL(__per_cpu_load) = .; \
736 .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
738 PERCPU_INPUT(cacheline) \
740 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu);
743 * PERCPU_SECTION - define output section for percpu area, simple version
744 * @cacheline: cacheline size
746 * Align to PAGE_SIZE and outputs output section for percpu area. This
747 * macro doesn't manipulate @vaddr or @phdr and __per_cpu_load and
748 * __per_cpu_start will be identical.
750 * This macro is equivalent to ALIGN(PAGE_SIZE); PERCPU_VADDR(@cacheline,,)
751 * except that __per_cpu_load is defined as a relative symbol against
752 * .data..percpu which is required for relocatable x86_32 configuration.
754 #define PERCPU_SECTION(cacheline) \
755 . = ALIGN(PAGE_SIZE); \
756 .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \
757 VMLINUX_SYMBOL(__per_cpu_load) = .; \
758 PERCPU_INPUT(cacheline) \
763 * Definition of the high level *_SECTION macros
764 * They will fit only a subset of the architectures
770 * All sections are combined in a single .data section.
771 * The sections following CONSTRUCTORS are arranged so their
772 * typical alignment matches.
773 * A cacheline is typical/always less than a PAGE_SIZE so
774 * the sections that has this restriction (or similar)
775 * is located before the ones requiring PAGE_SIZE alignment.
776 * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which
777 * matches the requirement of PAGE_ALIGNED_DATA.
779 * use 0 as page_align if page_aligned data is not used */
780 #define RW_DATA_SECTION(cacheline, pagealigned, inittask) \
781 . = ALIGN(PAGE_SIZE); \
782 .data : AT(ADDR(.data) - LOAD_OFFSET) { \
783 INIT_TASK_DATA(inittask) \
785 PAGE_ALIGNED_DATA(pagealigned) \
786 CACHELINE_ALIGNED_DATA(cacheline) \
787 READ_MOSTLY_DATA(cacheline) \
792 #define INIT_TEXT_SECTION(inittext_align) \
793 . = ALIGN(inittext_align); \
794 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { \
795 VMLINUX_SYMBOL(_sinittext) = .; \
797 VMLINUX_SYMBOL(_einittext) = .; \
800 #define INIT_DATA_SECTION(initsetup_align) \
801 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { \
803 INIT_SETUP(initsetup_align) \
810 #define BSS_SECTION(sbss_align, bss_align, stop_align) \
811 . = ALIGN(sbss_align); \
812 VMLINUX_SYMBOL(__bss_start) = .; \
815 . = ALIGN(stop_align); \
816 VMLINUX_SYMBOL(__bss_stop) = .;