1 /*
2  * Helper macros to support writing architecture specific
3  * linker scripts.
4  *
5  * A minimal linker scripts has following content:
6  * [This is a sample, architectures may have special requirements]
7  *
8  * OUTPUT_FORMAT(...)
9  * OUTPUT_ARCH(...)
10  * ENTRY(...)
11  * SECTIONS
12  * {
13  *	. = START;
14  *	__init_begin = .;
15  *	HEAD_TEXT_SECTION
16  *	INIT_TEXT_SECTION(PAGE_SIZE)
17  *	INIT_DATA_SECTION(...)
18  *	PERCPU_SECTION(CACHELINE_SIZE)
19  *	__init_end = .;
20  *
21  *	_stext = .;
22  *	TEXT_SECTION = 0
23  *	_etext = .;
24  *
25  *      _sdata = .;
26  *	RO_DATA(PAGE_SIZE)
27  *	RW_DATA(...)
28  *	_edata = .;
29  *
30  *	EXCEPTION_TABLE(...)
31  *
32  *	BSS_SECTION(0, 0, 0)
33  *	_end = .;
34  *
35  *	STABS_DEBUG
36  *	DWARF_DEBUG
37  *	ELF_DETAILS
38  *
39  *	DISCARDS		// must be the last
40  * }
41  *
42  * [__init_begin, __init_end] is the init section that may be freed after init
43  * 	// __init_begin and __init_end should be page aligned, so that we can
44  *	// free the whole .init memory
45  * [_stext, _etext] is the text section
46  * [_sdata, _edata] is the data section
47  *
48  * Some of the included output section have their own set of constants.
49  * Examples are: [__initramfs_start, __initramfs_end] for initramfs and
50  *               [__nosave_begin, __nosave_end] for the nosave data
51  */
52 
53 #include <asm-generic/codetag.lds.h>
54 
55 #ifndef LOAD_OFFSET
56 #define LOAD_OFFSET 0
57 #endif
58 
59 /*
60  * Only some architectures want to have the .notes segment visible in
61  * a separate PT_NOTE ELF Program Header. When this happens, it needs
62  * to be visible in both the kernel text's PT_LOAD and the PT_NOTE
63  * Program Headers. In this case, though, the PT_LOAD needs to be made
64  * the default again so that all the following sections don't also end
65  * up in the PT_NOTE Program Header.
66  */
67 #ifdef EMITS_PT_NOTE
68 #define NOTES_HEADERS		:text :note
69 #define NOTES_HEADERS_RESTORE	__restore_ph : { *(.__restore_ph) } :text
70 #else
71 #define NOTES_HEADERS
72 #define NOTES_HEADERS_RESTORE
73 #endif
74 
75 /*
76  * Some architectures have non-executable read-only exception tables.
77  * They can be added to the RO_DATA segment by specifying their desired
78  * alignment.
79  */
80 #ifdef RO_EXCEPTION_TABLE_ALIGN
81 #define RO_EXCEPTION_TABLE	EXCEPTION_TABLE(RO_EXCEPTION_TABLE_ALIGN)
82 #else
83 #define RO_EXCEPTION_TABLE
84 #endif
85 
86 /* Align . function alignment. */
87 #define ALIGN_FUNCTION()  . = ALIGN(CONFIG_FUNCTION_ALIGNMENT)
88 
89 /*
90  * LD_DEAD_CODE_DATA_ELIMINATION option enables -fdata-sections, which
91  * generates .data.identifier sections, which need to be pulled in with
92  * .data. We don't want to pull in .data..other sections, which Linux
93  * has defined. Same for text and bss.
94  *
95  * With LTO_CLANG, the linker also splits sections by default, so we need
96  * these macros to combine the sections during the final link.
97  *
98  * RODATA_MAIN is not used because existing code already defines .rodata.x
99  * sections to be brought in with rodata.
100  */
101 #if defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || defined(CONFIG_LTO_CLANG)
102 #define TEXT_MAIN .text .text.[0-9a-zA-Z_]*
103 #define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* .data.$__unnamed_* .data.$L*
104 #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]*
105 #define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L*
106 #define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral*
107 #define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]*
108 #else
109 #define TEXT_MAIN .text
110 #define DATA_MAIN .data
111 #define SDATA_MAIN .sdata
112 #define RODATA_MAIN .rodata
113 #define BSS_MAIN .bss
114 #define SBSS_MAIN .sbss
115 #endif
116 
117 /*
118  * GCC 4.5 and later have a 32 bytes section alignment for structures.
119  * Except GCC 4.9, that feels the need to align on 64 bytes.
120  */
121 #define STRUCT_ALIGNMENT 32
122 #define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT)
123 
124 /*
125  * The order of the sched class addresses are important, as they are
126  * used to determine the order of the priority of each sched class in
127  * relation to each other.
128  */
129 #define SCHED_DATA				\
130 	STRUCT_ALIGN();				\
131 	__sched_class_highest = .;		\
132 	*(__stop_sched_class)			\
133 	*(__dl_sched_class)			\
134 	*(__rt_sched_class)			\
135 	*(__fair_sched_class)			\
136 	*(__idle_sched_class)			\
137 	__sched_class_lowest = .;
138 
139 /* The actual configuration determine if the init/exit sections
140  * are handled as text/data or they can be discarded (which
141  * often happens at runtime)
142  */
143 
144 #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
145 #define KEEP_PATCHABLE		KEEP(*(__patchable_function_entries))
146 #define PATCHABLE_DISCARDS
147 #else
148 #define KEEP_PATCHABLE
149 #define PATCHABLE_DISCARDS	*(__patchable_function_entries)
150 #endif
151 
152 #ifndef CONFIG_ARCH_SUPPORTS_CFI_CLANG
153 /*
154  * Simply points to ftrace_stub, but with the proper protocol.
155  * Defined by the linker script in linux/vmlinux.lds.h
156  */
157 #define	FTRACE_STUB_HACK	ftrace_stub_graph = ftrace_stub;
158 #else
159 #define FTRACE_STUB_HACK
160 #endif
161 
162 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
163 /*
164  * The ftrace call sites are logged to a section whose name depends on the
165  * compiler option used. A given kernel image will only use one, AKA
166  * FTRACE_CALLSITE_SECTION. We capture all of them here to avoid header
167  * dependencies for FTRACE_CALLSITE_SECTION's definition.
168  *
169  * ftrace_ops_list_func will be defined as arch_ftrace_ops_list_func
170  * as some archs will have a different prototype for that function
171  * but ftrace_ops_list_func() will have a single prototype.
172  */
173 #define MCOUNT_REC()	. = ALIGN(8);				\
174 			__start_mcount_loc = .;			\
175 			KEEP(*(__mcount_loc))			\
176 			KEEP_PATCHABLE				\
177 			__stop_mcount_loc = .;			\
178 			FTRACE_STUB_HACK			\
179 			ftrace_ops_list_func = arch_ftrace_ops_list_func;
180 #else
181 # ifdef CONFIG_FUNCTION_TRACER
182 #  define MCOUNT_REC()	FTRACE_STUB_HACK			\
183 			ftrace_ops_list_func = arch_ftrace_ops_list_func;
184 # else
185 #  define MCOUNT_REC()
186 # endif
187 #endif
188 
189 #define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_)	\
190 	_BEGIN_##_label_ = .;						\
191 	KEEP(*(_sec_))							\
192 	_END_##_label_ = .;
193 
194 #define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_)	\
195 	_label_##_BEGIN_ = .;						\
196 	KEEP(*(_sec_))							\
197 	_label_##_END_ = .;
198 
199 #define BOUNDED_SECTION_BY(_sec_, _label_)				\
200 	BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop)
201 
202 #define BOUNDED_SECTION(_sec)	 BOUNDED_SECTION_BY(_sec, _sec)
203 
204 #define HEADERED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \
205 	_HDR_##_label_	= .;						\
206 	KEEP(*(.gnu.linkonce.##_sec_))					\
207 	BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_)
208 
209 #define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \
210 	_label_##_HDR_ = .;						\
211 	KEEP(*(.gnu.linkonce.##_sec_))					\
212 	BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_)
213 
214 #define HEADERED_SECTION_BY(_sec_, _label_)				\
215 	HEADERED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop)
216 
217 #define HEADERED_SECTION(_sec)	 HEADERED_SECTION_BY(_sec, _sec)
218 
219 #ifdef CONFIG_TRACE_BRANCH_PROFILING
220 #define LIKELY_PROFILE()						\
221 	BOUNDED_SECTION_BY(_ftrace_annotated_branch, _annotated_branch_profile)
222 #else
223 #define LIKELY_PROFILE()
224 #endif
225 
226 #ifdef CONFIG_PROFILE_ALL_BRANCHES
227 #define BRANCH_PROFILE()					\
228 	BOUNDED_SECTION_BY(_ftrace_branch, _branch_profile)
229 #else
230 #define BRANCH_PROFILE()
231 #endif
232 
233 #ifdef CONFIG_KPROBES
234 #define KPROBE_BLACKLIST()				\
235 	. = ALIGN(8);					\
236 	BOUNDED_SECTION(_kprobe_blacklist)
237 #else
238 #define KPROBE_BLACKLIST()
239 #endif
240 
241 #ifdef CONFIG_FUNCTION_ERROR_INJECTION
242 #define ERROR_INJECT_WHITELIST()			\
243 	STRUCT_ALIGN();					\
244 	BOUNDED_SECTION(_error_injection_whitelist)
245 #else
246 #define ERROR_INJECT_WHITELIST()
247 #endif
248 
249 #ifdef CONFIG_EVENT_TRACING
250 #define FTRACE_EVENTS()							\
251 	. = ALIGN(8);							\
252 	BOUNDED_SECTION(_ftrace_events)					\
253 	BOUNDED_SECTION_BY(_ftrace_eval_map, _ftrace_eval_maps)
254 #else
255 #define FTRACE_EVENTS()
256 #endif
257 
258 #ifdef CONFIG_TRACING
259 #define TRACE_PRINTKS()		BOUNDED_SECTION_BY(__trace_printk_fmt, ___trace_bprintk_fmt)
260 #define TRACEPOINT_STR()	BOUNDED_SECTION_BY(__tracepoint_str, ___tracepoint_str)
261 #else
262 #define TRACE_PRINTKS()
263 #define TRACEPOINT_STR()
264 #endif
265 
266 #ifdef CONFIG_FTRACE_SYSCALLS
267 #define TRACE_SYSCALLS()			\
268 	. = ALIGN(8);				\
269 	BOUNDED_SECTION_BY(__syscalls_metadata, _syscalls_metadata)
270 #else
271 #define TRACE_SYSCALLS()
272 #endif
273 
274 #ifdef CONFIG_BPF_EVENTS
275 #define BPF_RAW_TP() STRUCT_ALIGN();				\
276 	BOUNDED_SECTION_BY(__bpf_raw_tp_map, __bpf_raw_tp)
277 #else
278 #define BPF_RAW_TP()
279 #endif
280 
281 #ifdef CONFIG_SERIAL_EARLYCON
282 #define EARLYCON_TABLE()						\
283 	. = ALIGN(8);							\
284 	BOUNDED_SECTION_POST_LABEL(__earlycon_table, __earlycon_table, , _end)
285 #else
286 #define EARLYCON_TABLE()
287 #endif
288 
289 #ifdef CONFIG_SECURITY
290 #define LSM_TABLE()					\
291 	. = ALIGN(8);					\
292 	BOUNDED_SECTION_PRE_LABEL(.lsm_info.init, _lsm_info, __start, __end)
293 
294 #define EARLY_LSM_TABLE()						\
295 	. = ALIGN(8);							\
296 	BOUNDED_SECTION_PRE_LABEL(.early_lsm_info.init, _early_lsm_info, __start, __end)
297 #else
298 #define LSM_TABLE()
299 #define EARLY_LSM_TABLE()
300 #endif
301 
302 #define ___OF_TABLE(cfg, name)	_OF_TABLE_##cfg(name)
303 #define __OF_TABLE(cfg, name)	___OF_TABLE(cfg, name)
304 #define OF_TABLE(cfg, name)	__OF_TABLE(IS_ENABLED(cfg), name)
305 #define _OF_TABLE_0(name)
306 #define _OF_TABLE_1(name)						\
307 	. = ALIGN(8);							\
308 	__##name##_of_table = .;					\
309 	KEEP(*(__##name##_of_table))					\
310 	KEEP(*(__##name##_of_table_end))
311 
312 #define TIMER_OF_TABLES()	OF_TABLE(CONFIG_TIMER_OF, timer)
313 #define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip)
314 #define CLK_OF_TABLES()		OF_TABLE(CONFIG_COMMON_CLK, clk)
315 #define RESERVEDMEM_OF_TABLES()	OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem)
316 #define CPU_METHOD_OF_TABLES()	OF_TABLE(CONFIG_SMP, cpu_method)
317 #define CPUIDLE_METHOD_OF_TABLES() OF_TABLE(CONFIG_CPU_IDLE, cpuidle_method)
318 
319 #ifdef CONFIG_ACPI
320 #define ACPI_PROBE_TABLE(name)						\
321 	. = ALIGN(8);							\
322 	BOUNDED_SECTION_POST_LABEL(__##name##_acpi_probe_table,		\
323 				   __##name##_acpi_probe_table,, _end)
324 #else
325 #define ACPI_PROBE_TABLE(name)
326 #endif
327 
328 #ifdef CONFIG_THERMAL
329 #define THERMAL_TABLE(name)						\
330 	. = ALIGN(8);							\
331 	BOUNDED_SECTION_POST_LABEL(__##name##_thermal_table,		\
332 				   __##name##_thermal_table,, _end)
333 #else
334 #define THERMAL_TABLE(name)
335 #endif
336 
337 #define KERNEL_DTB()							\
338 	STRUCT_ALIGN();							\
339 	__dtb_start = .;						\
340 	KEEP(*(.dtb.init.rodata))					\
341 	__dtb_end = .;
342 
343 /*
344  * .data section
345  */
346 #define DATA_DATA							\
347 	*(.xiptext)							\
348 	*(DATA_MAIN)							\
349 	*(.data..decrypted)						\
350 	*(.ref.data)							\
351 	*(.data..shared_aligned) /* percpu related */			\
352 	*(.data.unlikely)						\
353 	__start_once = .;						\
354 	*(.data.once)							\
355 	__end_once = .;							\
356 	STRUCT_ALIGN();							\
357 	*(__tracepoints)						\
358 	/* implement dynamic printk debug */				\
359 	. = ALIGN(8);							\
360 	BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes)		\
361 	BOUNDED_SECTION_BY(__dyndbg, ___dyndbg)				\
362 	CODETAG_SECTIONS()						\
363 	LIKELY_PROFILE()		       				\
364 	BRANCH_PROFILE()						\
365 	TRACE_PRINTKS()							\
366 	BPF_RAW_TP()							\
367 	TRACEPOINT_STR()						\
368 	KUNIT_TABLE()
369 
370 /*
371  * Data section helpers
372  */
373 #define NOSAVE_DATA							\
374 	. = ALIGN(PAGE_SIZE);						\
375 	__nosave_begin = .;						\
376 	*(.data..nosave)						\
377 	. = ALIGN(PAGE_SIZE);						\
378 	__nosave_end = .;
379 
380 #define PAGE_ALIGNED_DATA(page_align)					\
381 	. = ALIGN(page_align);						\
382 	*(.data..page_aligned)						\
383 	. = ALIGN(page_align);
384 
385 #define READ_MOSTLY_DATA(align)						\
386 	. = ALIGN(align);						\
387 	*(.data..read_mostly)						\
388 	. = ALIGN(align);
389 
390 #define CACHELINE_ALIGNED_DATA(align)					\
391 	. = ALIGN(align);						\
392 	*(.data..cacheline_aligned)
393 
394 #define INIT_TASK_DATA(align)						\
395 	. = ALIGN(align);						\
396 	__start_init_stack = .;						\
397 	init_thread_union = .;						\
398 	init_stack = .;							\
399 	KEEP(*(.data..init_task))					\
400 	KEEP(*(.data..init_thread_info))				\
401 	. = __start_init_stack + THREAD_SIZE;				\
402 	__end_init_stack = .;
403 
404 #define JUMP_TABLE_DATA							\
405 	. = ALIGN(8);							\
406 	BOUNDED_SECTION_BY(__jump_table, ___jump_table)
407 
408 #ifdef CONFIG_HAVE_STATIC_CALL_INLINE
409 #define STATIC_CALL_DATA						\
410 	. = ALIGN(8);							\
411 	BOUNDED_SECTION_BY(.static_call_sites, _static_call_sites)	\
412 	BOUNDED_SECTION_BY(.static_call_tramp_key, _static_call_tramp_key)
413 #else
414 #define STATIC_CALL_DATA
415 #endif
416 
417 /*
418  * Allow architectures to handle ro_after_init data on their
419  * own by defining an empty RO_AFTER_INIT_DATA.
420  */
421 #ifndef RO_AFTER_INIT_DATA
422 #define RO_AFTER_INIT_DATA						\
423 	. = ALIGN(8);							\
424 	__start_ro_after_init = .;					\
425 	*(.data..ro_after_init)						\
426 	JUMP_TABLE_DATA							\
427 	STATIC_CALL_DATA						\
428 	__end_ro_after_init = .;
429 #endif
430 
431 /*
432  * .kcfi_traps contains a list KCFI trap locations.
433  */
434 #ifndef KCFI_TRAPS
435 #ifdef CONFIG_ARCH_USES_CFI_TRAPS
436 #define KCFI_TRAPS							\
437 	__kcfi_traps : AT(ADDR(__kcfi_traps) - LOAD_OFFSET) {		\
438 		BOUNDED_SECTION_BY(.kcfi_traps, ___kcfi_traps)		\
439 	}
440 #else
441 #define KCFI_TRAPS
442 #endif
443 #endif
444 
445 /*
446  * Some symbol definitions will not exist yet during the first pass of the
447  * link, but are guaranteed to exist in the final link. Provide preliminary
448  * definitions that will be superseded in the final link to avoid having to
449  * rely on weak external linkage, which requires a GOT when used in position
450  * independent code.
451  */
452 #define PRELIMINARY_SYMBOL_DEFINITIONS					\
453 	PROVIDE(kallsyms_addresses = .);				\
454 	PROVIDE(kallsyms_offsets = .);					\
455 	PROVIDE(kallsyms_names = .);					\
456 	PROVIDE(kallsyms_num_syms = .);					\
457 	PROVIDE(kallsyms_relative_base = .);				\
458 	PROVIDE(kallsyms_token_table = .);				\
459 	PROVIDE(kallsyms_token_index = .);				\
460 	PROVIDE(kallsyms_markers = .);					\
461 	PROVIDE(kallsyms_seqs_of_names = .);
462 
463 /*
464  * Read only Data
465  */
466 #define RO_DATA(align)							\
467 	. = ALIGN((align));						\
468 	PRELIMINARY_SYMBOL_DEFINITIONS					\
469 	.rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {		\
470 		__start_rodata = .;					\
471 		*(.rodata) *(.rodata.*)					\
472 		SCHED_DATA						\
473 		RO_AFTER_INIT_DATA	/* Read only after init */	\
474 		. = ALIGN(8);						\
475 		BOUNDED_SECTION_BY(__tracepoints_ptrs, ___tracepoints_ptrs) \
476 		*(__tracepoints_strings)/* Tracepoints: strings */	\
477 	}								\
478 									\
479 	.rodata1          : AT(ADDR(.rodata1) - LOAD_OFFSET) {		\
480 		*(.rodata1)						\
481 	}								\
482 									\
483 	/* PCI quirks */						\
484 	.pci_fixup        : AT(ADDR(.pci_fixup) - LOAD_OFFSET) {	\
485 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_early,  _pci_fixups_early,  __start, __end) \
486 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_header, _pci_fixups_header, __start, __end) \
487 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_final,  _pci_fixups_final,  __start, __end) \
488 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_enable, _pci_fixups_enable, __start, __end) \
489 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_resume, _pci_fixups_resume, __start, __end) \
490 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_suspend, _pci_fixups_suspend, __start, __end) \
491 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_resume_early, _pci_fixups_resume_early, __start, __end) \
492 		BOUNDED_SECTION_PRE_LABEL(.pci_fixup_suspend_late, _pci_fixups_suspend_late, __start, __end) \
493 	}								\
494 									\
495 	FW_LOADER_BUILT_IN_DATA						\
496 	TRACEDATA							\
497 									\
498 	PRINTK_INDEX							\
499 									\
500 	/* Kernel symbol table: Normal symbols */			\
501 	__ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {		\
502 		__start___ksymtab = .;					\
503 		KEEP(*(SORT(___ksymtab+*)))				\
504 		__stop___ksymtab = .;					\
505 	}								\
506 									\
507 	/* Kernel symbol table: GPL-only symbols */			\
508 	__ksymtab_gpl     : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) {	\
509 		__start___ksymtab_gpl = .;				\
510 		KEEP(*(SORT(___ksymtab_gpl+*)))				\
511 		__stop___ksymtab_gpl = .;				\
512 	}								\
513 									\
514 	/* Kernel symbol table: Normal symbols */			\
515 	__kcrctab         : AT(ADDR(__kcrctab) - LOAD_OFFSET) {		\
516 		__start___kcrctab = .;					\
517 		KEEP(*(SORT(___kcrctab+*)))				\
518 		__stop___kcrctab = .;					\
519 	}								\
520 									\
521 	/* Kernel symbol table: GPL-only symbols */			\
522 	__kcrctab_gpl     : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) {	\
523 		__start___kcrctab_gpl = .;				\
524 		KEEP(*(SORT(___kcrctab_gpl+*)))				\
525 		__stop___kcrctab_gpl = .;				\
526 	}								\
527 									\
528 	/* Kernel symbol table: strings */				\
529         __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {	\
530 		*(__ksymtab_strings)					\
531 	}								\
532 									\
533 	/* __*init sections */						\
534 	__init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) {		\
535 		*(.ref.rodata)						\
536 	}								\
537 									\
538 	/* Built-in module parameters. */				\
539 	__param : AT(ADDR(__param) - LOAD_OFFSET) {			\
540 		BOUNDED_SECTION_BY(__param, ___param)			\
541 	}								\
542 									\
543 	/* Built-in module versions. */					\
544 	__modver : AT(ADDR(__modver) - LOAD_OFFSET) {			\
545 		BOUNDED_SECTION_BY(__modver, ___modver)			\
546 	}								\
547 									\
548 	KCFI_TRAPS							\
549 									\
550 	RO_EXCEPTION_TABLE						\
551 	NOTES								\
552 	BTF								\
553 									\
554 	. = ALIGN((align));						\
555 	__end_rodata = .;
556 
557 
558 /*
559  * Non-instrumentable text section
560  */
561 #define NOINSTR_TEXT							\
562 		ALIGN_FUNCTION();					\
563 		__noinstr_text_start = .;				\
564 		*(.noinstr.text)					\
565 		__cpuidle_text_start = .;				\
566 		*(.cpuidle.text)					\
567 		__cpuidle_text_end = .;					\
568 		__noinstr_text_end = .;
569 
570 /*
571  * .text section. Map to function alignment to avoid address changes
572  * during second ld run in second ld pass when generating System.map
573  *
574  * TEXT_MAIN here will match .text.fixup and .text.unlikely if dead
575  * code elimination is enabled, so these sections should be converted
576  * to use ".." first.
577  */
578 #define TEXT_TEXT							\
579 		ALIGN_FUNCTION();					\
580 		*(.text.hot .text.hot.*)				\
581 		*(TEXT_MAIN .text.fixup)				\
582 		*(.text.unlikely .text.unlikely.*)			\
583 		*(.text.unknown .text.unknown.*)			\
584 		NOINSTR_TEXT						\
585 		*(.ref.text)						\
586 		*(.text.asan.* .text.tsan.*)
587 
588 
589 /* sched.text is aling to function alignment to secure we have same
590  * address even at second ld pass when generating System.map */
591 #define SCHED_TEXT							\
592 		ALIGN_FUNCTION();					\
593 		__sched_text_start = .;					\
594 		*(.sched.text)						\
595 		__sched_text_end = .;
596 
597 /* spinlock.text is aling to function alignment to secure we have same
598  * address even at second ld pass when generating System.map */
599 #define LOCK_TEXT							\
600 		ALIGN_FUNCTION();					\
601 		__lock_text_start = .;					\
602 		*(.spinlock.text)					\
603 		__lock_text_end = .;
604 
605 #define KPROBES_TEXT							\
606 		ALIGN_FUNCTION();					\
607 		__kprobes_text_start = .;				\
608 		*(.kprobes.text)					\
609 		__kprobes_text_end = .;
610 
611 #define ENTRY_TEXT							\
612 		ALIGN_FUNCTION();					\
613 		__entry_text_start = .;					\
614 		*(.entry.text)						\
615 		__entry_text_end = .;
616 
617 #define IRQENTRY_TEXT							\
618 		ALIGN_FUNCTION();					\
619 		__irqentry_text_start = .;				\
620 		*(.irqentry.text)					\
621 		__irqentry_text_end = .;
622 
623 #define SOFTIRQENTRY_TEXT						\
624 		ALIGN_FUNCTION();					\
625 		__softirqentry_text_start = .;				\
626 		*(.softirqentry.text)					\
627 		__softirqentry_text_end = .;
628 
629 #define STATIC_CALL_TEXT						\
630 		ALIGN_FUNCTION();					\
631 		__static_call_text_start = .;				\
632 		*(.static_call.text)					\
633 		__static_call_text_end = .;
634 
635 /* Section used for early init (in .S files) */
636 #define HEAD_TEXT  KEEP(*(.head.text))
637 
638 #define HEAD_TEXT_SECTION							\
639 	.head.text : AT(ADDR(.head.text) - LOAD_OFFSET) {		\
640 		HEAD_TEXT						\
641 	}
642 
643 /*
644  * Exception table
645  */
646 #define EXCEPTION_TABLE(align)						\
647 	. = ALIGN(align);						\
648 	__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {		\
649 		BOUNDED_SECTION_BY(__ex_table, ___ex_table)		\
650 	}
651 
652 /*
653  * .BTF
654  */
655 #ifdef CONFIG_DEBUG_INFO_BTF
656 #define BTF								\
657 	.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {				\
658 		BOUNDED_SECTION_BY(.BTF, _BTF)				\
659 	}								\
660 	. = ALIGN(4);							\
661 	.BTF_ids : AT(ADDR(.BTF_ids) - LOAD_OFFSET) {			\
662 		*(.BTF_ids)						\
663 	}
664 #else
665 #define BTF
666 #endif
667 
668 /*
669  * Init task
670  */
671 #define INIT_TASK_DATA_SECTION(align)					\
672 	. = ALIGN(align);						\
673 	.data..init_task :  AT(ADDR(.data..init_task) - LOAD_OFFSET) {	\
674 		INIT_TASK_DATA(align)					\
675 	}
676 
677 #ifdef CONFIG_CONSTRUCTORS
678 #define KERNEL_CTORS()	. = ALIGN(8);			   \
679 			__ctors_start = .;		   \
680 			KEEP(*(SORT(.ctors.*)))		   \
681 			KEEP(*(.ctors))			   \
682 			KEEP(*(SORT(.init_array.*)))	   \
683 			KEEP(*(.init_array))		   \
684 			__ctors_end = .;
685 #else
686 #define KERNEL_CTORS()
687 #endif
688 
689 /* init and exit section handling */
690 #define INIT_DATA							\
691 	KEEP(*(SORT(___kentry+*)))					\
692 	*(.init.data .init.data.*)					\
693 	KERNEL_CTORS()							\
694 	MCOUNT_REC()							\
695 	*(.init.rodata .init.rodata.*)					\
696 	FTRACE_EVENTS()							\
697 	TRACE_SYSCALLS()						\
698 	KPROBE_BLACKLIST()						\
699 	ERROR_INJECT_WHITELIST()					\
700 	CLK_OF_TABLES()							\
701 	RESERVEDMEM_OF_TABLES()						\
702 	TIMER_OF_TABLES()						\
703 	CPU_METHOD_OF_TABLES()						\
704 	CPUIDLE_METHOD_OF_TABLES()					\
705 	KERNEL_DTB()							\
706 	IRQCHIP_OF_MATCH_TABLE()					\
707 	ACPI_PROBE_TABLE(irqchip)					\
708 	ACPI_PROBE_TABLE(timer)						\
709 	THERMAL_TABLE(governor)						\
710 	EARLYCON_TABLE()						\
711 	LSM_TABLE()							\
712 	EARLY_LSM_TABLE()						\
713 	KUNIT_INIT_TABLE()
714 
715 #define INIT_TEXT							\
716 	*(.init.text .init.text.*)					\
717 	*(.text.startup)
718 
719 #define EXIT_DATA							\
720 	*(.exit.data .exit.data.*)					\
721 	*(.fini_array .fini_array.*)					\
722 	*(.dtors .dtors.*)						\
723 
724 #define EXIT_TEXT							\
725 	*(.exit.text)							\
726 	*(.text.exit)							\
727 
728 #define EXIT_CALL							\
729 	*(.exitcall.exit)
730 
731 /*
732  * bss (Block Started by Symbol) - uninitialized data
733  * zeroed during startup
734  */
735 #define SBSS(sbss_align)						\
736 	. = ALIGN(sbss_align);						\
737 	.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {				\
738 		*(.dynsbss)						\
739 		*(SBSS_MAIN)						\
740 		*(.scommon)						\
741 	}
742 
743 /*
744  * Allow archectures to redefine BSS_FIRST_SECTIONS to add extra
745  * sections to the front of bss.
746  */
747 #ifndef BSS_FIRST_SECTIONS
748 #define BSS_FIRST_SECTIONS
749 #endif
750 
751 #define BSS(bss_align)							\
752 	. = ALIGN(bss_align);						\
753 	.bss : AT(ADDR(.bss) - LOAD_OFFSET) {				\
754 		BSS_FIRST_SECTIONS					\
755 		. = ALIGN(PAGE_SIZE);					\
756 		*(.bss..page_aligned)					\
757 		. = ALIGN(PAGE_SIZE);					\
758 		*(.dynbss)						\
759 		*(BSS_MAIN)						\
760 		*(COMMON)						\
761 	}
762 
763 /*
764  * DWARF debug sections.
765  * Symbols in the DWARF debugging sections are relative to
766  * the beginning of the section so we begin them at 0.
767  */
768 #define DWARF_DEBUG							\
769 		/* DWARF 1 */						\
770 		.debug          0 : { *(.debug) }			\
771 		.line           0 : { *(.line) }			\
772 		/* GNU DWARF 1 extensions */				\
773 		.debug_srcinfo  0 : { *(.debug_srcinfo) }		\
774 		.debug_sfnames  0 : { *(.debug_sfnames) }		\
775 		/* DWARF 1.1 and DWARF 2 */				\
776 		.debug_aranges  0 : { *(.debug_aranges) }		\
777 		.debug_pubnames 0 : { *(.debug_pubnames) }		\
778 		/* DWARF 2 */						\
779 		.debug_info     0 : { *(.debug_info			\
780 				.gnu.linkonce.wi.*) }			\
781 		.debug_abbrev   0 : { *(.debug_abbrev) }		\
782 		.debug_line     0 : { *(.debug_line) }			\
783 		.debug_frame    0 : { *(.debug_frame) }			\
784 		.debug_str      0 : { *(.debug_str) }			\
785 		.debug_loc      0 : { *(.debug_loc) }			\
786 		.debug_macinfo  0 : { *(.debug_macinfo) }		\
787 		.debug_pubtypes 0 : { *(.debug_pubtypes) }		\
788 		/* DWARF 3 */						\
789 		.debug_ranges	0 : { *(.debug_ranges) }		\
790 		/* SGI/MIPS DWARF 2 extensions */			\
791 		.debug_weaknames 0 : { *(.debug_weaknames) }		\
792 		.debug_funcnames 0 : { *(.debug_funcnames) }		\
793 		.debug_typenames 0 : { *(.debug_typenames) }		\
794 		.debug_varnames  0 : { *(.debug_varnames) }		\
795 		/* GNU DWARF 2 extensions */				\
796 		.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }	\
797 		.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }	\
798 		/* DWARF 4 */						\
799 		.debug_types	0 : { *(.debug_types) }			\
800 		/* DWARF 5 */						\
801 		.debug_addr	0 : { *(.debug_addr) }			\
802 		.debug_line_str	0 : { *(.debug_line_str) }		\
803 		.debug_loclists	0 : { *(.debug_loclists) }		\
804 		.debug_macro	0 : { *(.debug_macro) }			\
805 		.debug_names	0 : { *(.debug_names) }			\
806 		.debug_rnglists	0 : { *(.debug_rnglists) }		\
807 		.debug_str_offsets	0 : { *(.debug_str_offsets) }
808 
809 /* Stabs debugging sections. */
810 #define STABS_DEBUG							\
811 		.stab 0 : { *(.stab) }					\
812 		.stabstr 0 : { *(.stabstr) }				\
813 		.stab.excl 0 : { *(.stab.excl) }			\
814 		.stab.exclstr 0 : { *(.stab.exclstr) }			\
815 		.stab.index 0 : { *(.stab.index) }			\
816 		.stab.indexstr 0 : { *(.stab.indexstr) }
817 
818 /* Required sections not related to debugging. */
819 #define ELF_DETAILS							\
820 		.comment 0 : { *(.comment) }				\
821 		.symtab 0 : { *(.symtab) }				\
822 		.strtab 0 : { *(.strtab) }				\
823 		.shstrtab 0 : { *(.shstrtab) }
824 
825 #ifdef CONFIG_GENERIC_BUG
826 #define BUG_TABLE							\
827 	. = ALIGN(8);							\
828 	__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {		\
829 		BOUNDED_SECTION_BY(__bug_table, ___bug_table)		\
830 	}
831 #else
832 #define BUG_TABLE
833 #endif
834 
835 #ifdef CONFIG_UNWINDER_ORC
836 #define ORC_UNWIND_TABLE						\
837 	.orc_header : AT(ADDR(.orc_header) - LOAD_OFFSET) {		\
838 		BOUNDED_SECTION_BY(.orc_header, _orc_header)		\
839 	}								\
840 	. = ALIGN(4);							\
841 	.orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) {	\
842 		BOUNDED_SECTION_BY(.orc_unwind_ip, _orc_unwind_ip)	\
843 	}								\
844 	. = ALIGN(2);							\
845 	.orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) {		\
846 		BOUNDED_SECTION_BY(.orc_unwind, _orc_unwind)		\
847 	}								\
848 	text_size = _etext - _stext;					\
849 	. = ALIGN(4);							\
850 	.orc_lookup : AT(ADDR(.orc_lookup) - LOAD_OFFSET) {		\
851 		orc_lookup = .;						\
852 		. += (((text_size + LOOKUP_BLOCK_SIZE - 1) /		\
853 			LOOKUP_BLOCK_SIZE) + 1) * 4;			\
854 		orc_lookup_end = .;					\
855 	}
856 #else
857 #define ORC_UNWIND_TABLE
858 #endif
859 
860 /* Built-in firmware blobs */
861 #ifdef CONFIG_FW_LOADER
862 #define FW_LOADER_BUILT_IN_DATA						\
863 	.builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) {	\
864 		BOUNDED_SECTION_PRE_LABEL(.builtin_fw, _builtin_fw, __start, __end) \
865 	}
866 #else
867 #define FW_LOADER_BUILT_IN_DATA
868 #endif
869 
870 #ifdef CONFIG_PM_TRACE
871 #define TRACEDATA							\
872 	. = ALIGN(4);							\
873 	.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {		\
874 		BOUNDED_SECTION_POST_LABEL(.tracedata, __tracedata, _start, _end) \
875 	}
876 #else
877 #define TRACEDATA
878 #endif
879 
880 #ifdef CONFIG_PRINTK_INDEX
881 #define PRINTK_INDEX							\
882 	.printk_index : AT(ADDR(.printk_index) - LOAD_OFFSET) {		\
883 		BOUNDED_SECTION_BY(.printk_index, _printk_index)	\
884 	}
885 #else
886 #define PRINTK_INDEX
887 #endif
888 
889 /*
890  * Discard .note.GNU-stack, which is emitted as PROGBITS by the compiler.
891  * Otherwise, the type of .notes section would become PROGBITS instead of NOTES.
892  *
893  * Also, discard .note.gnu.property, otherwise it forces the notes section to
894  * be 8-byte aligned which causes alignment mismatches with the kernel's custom
895  * 4-byte aligned notes.
896  */
897 #define NOTES								\
898 	/DISCARD/ : {							\
899 		*(.note.GNU-stack)					\
900 		*(.note.gnu.property)					\
901 	}								\
902 	.notes : AT(ADDR(.notes) - LOAD_OFFSET) {			\
903 		BOUNDED_SECTION_BY(.note.*, _notes)			\
904 	} NOTES_HEADERS							\
905 	NOTES_HEADERS_RESTORE
906 
907 #define INIT_SETUP(initsetup_align)					\
908 		. = ALIGN(initsetup_align);				\
909 		BOUNDED_SECTION_POST_LABEL(.init.setup, __setup, _start, _end)
910 
911 #define INIT_CALLS_LEVEL(level)						\
912 		__initcall##level##_start = .;				\
913 		KEEP(*(.initcall##level##.init))			\
914 		KEEP(*(.initcall##level##s.init))			\
915 
916 #define INIT_CALLS							\
917 		__initcall_start = .;					\
918 		KEEP(*(.initcallearly.init))				\
919 		INIT_CALLS_LEVEL(0)					\
920 		INIT_CALLS_LEVEL(1)					\
921 		INIT_CALLS_LEVEL(2)					\
922 		INIT_CALLS_LEVEL(3)					\
923 		INIT_CALLS_LEVEL(4)					\
924 		INIT_CALLS_LEVEL(5)					\
925 		INIT_CALLS_LEVEL(rootfs)				\
926 		INIT_CALLS_LEVEL(6)					\
927 		INIT_CALLS_LEVEL(7)					\
928 		__initcall_end = .;
929 
930 #define CON_INITCALL							\
931 	BOUNDED_SECTION_POST_LABEL(.con_initcall.init, __con_initcall, _start, _end)
932 
933 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */
934 #define KUNIT_TABLE()							\
935 		. = ALIGN(8);						\
936 		BOUNDED_SECTION_POST_LABEL(.kunit_test_suites, __kunit_suites, _start, _end)
937 
938 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */
939 #define KUNIT_INIT_TABLE()						\
940 		. = ALIGN(8);						\
941 		BOUNDED_SECTION_POST_LABEL(.kunit_init_test_suites, \
942 				__kunit_init_suites, _start, _end)
943 
944 #ifdef CONFIG_BLK_DEV_INITRD
945 #define INIT_RAM_FS							\
946 	. = ALIGN(4);							\
947 	__initramfs_start = .;						\
948 	KEEP(*(.init.ramfs))						\
949 	. = ALIGN(8);							\
950 	KEEP(*(.init.ramfs.info))
951 #else
952 #define INIT_RAM_FS
953 #endif
954 
955 /*
956  * Memory encryption operates on a page basis. Since we need to clear
957  * the memory encryption mask for this section, it needs to be aligned
958  * on a page boundary and be a page-size multiple in length.
959  *
960  * Note: We use a separate section so that only this section gets
961  * decrypted to avoid exposing more than we wish.
962  */
963 #ifdef CONFIG_AMD_MEM_ENCRYPT
964 #define PERCPU_DECRYPTED_SECTION					\
965 	. = ALIGN(PAGE_SIZE);						\
966 	*(.data..percpu..decrypted)					\
967 	. = ALIGN(PAGE_SIZE);
968 #else
969 #define PERCPU_DECRYPTED_SECTION
970 #endif
971 
972 
973 /*
974  * Default discarded sections.
975  *
976  * Some archs want to discard exit text/data at runtime rather than
977  * link time due to cross-section references such as alt instructions,
978  * bug table, eh_frame, etc.  DISCARDS must be the last of output
979  * section definitions so that such archs put those in earlier section
980  * definitions.
981  */
982 #ifdef RUNTIME_DISCARD_EXIT
983 #define EXIT_DISCARDS
984 #else
985 #define EXIT_DISCARDS							\
986 	EXIT_TEXT							\
987 	EXIT_DATA
988 #endif
989 
990 /*
991  * Clang's -fprofile-arcs, -fsanitize=kernel-address, and
992  * -fsanitize=thread produce unwanted sections (.eh_frame
993  * and .init_array.*), but CONFIG_CONSTRUCTORS wants to
994  * keep any .init_array.* sections.
995  * https://llvm.org/pr46478
996  */
997 #ifdef CONFIG_UNWIND_TABLES
998 #define DISCARD_EH_FRAME
999 #else
1000 #define DISCARD_EH_FRAME	*(.eh_frame)
1001 #endif
1002 #if defined(CONFIG_GCOV_KERNEL) || defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KCSAN)
1003 # ifdef CONFIG_CONSTRUCTORS
1004 #  define SANITIZER_DISCARDS						\
1005 	DISCARD_EH_FRAME
1006 # else
1007 #  define SANITIZER_DISCARDS						\
1008 	*(.init_array) *(.init_array.*)					\
1009 	DISCARD_EH_FRAME
1010 # endif
1011 #else
1012 # define SANITIZER_DISCARDS
1013 #endif
1014 
1015 #define COMMON_DISCARDS							\
1016 	SANITIZER_DISCARDS						\
1017 	PATCHABLE_DISCARDS						\
1018 	*(.discard)							\
1019 	*(.discard.*)							\
1020 	*(.export_symbol)						\
1021 	*(.modinfo)							\
1022 	/* ld.bfd warns about .gnu.version* even when not emitted */	\
1023 	*(.gnu.version*)						\
1024 
1025 #define DISCARDS							\
1026 	/DISCARD/ : {							\
1027 	EXIT_DISCARDS							\
1028 	EXIT_CALL							\
1029 	COMMON_DISCARDS							\
1030 	}
1031 
1032 /**
1033  * PERCPU_INPUT - the percpu input sections
1034  * @cacheline: cacheline size
1035  *
1036  * The core percpu section names and core symbols which do not rely
1037  * directly upon load addresses.
1038  *
1039  * @cacheline is used to align subsections to avoid false cacheline
1040  * sharing between subsections for different purposes.
1041  */
1042 #define PERCPU_INPUT(cacheline)						\
1043 	__per_cpu_start = .;						\
1044 	*(.data..percpu..first)						\
1045 	. = ALIGN(PAGE_SIZE);						\
1046 	*(.data..percpu..page_aligned)					\
1047 	. = ALIGN(cacheline);						\
1048 	*(.data..percpu..read_mostly)					\
1049 	. = ALIGN(cacheline);						\
1050 	*(.data..percpu)						\
1051 	*(.data..percpu..shared_aligned)				\
1052 	PERCPU_DECRYPTED_SECTION					\
1053 	__per_cpu_end = .;
1054 
1055 /**
1056  * PERCPU_VADDR - define output section for percpu area
1057  * @cacheline: cacheline size
1058  * @vaddr: explicit base address (optional)
1059  * @phdr: destination PHDR (optional)
1060  *
1061  * Macro which expands to output section for percpu area.
1062  *
1063  * @cacheline is used to align subsections to avoid false cacheline
1064  * sharing between subsections for different purposes.
1065  *
1066  * If @vaddr is not blank, it specifies explicit base address and all
1067  * percpu symbols will be offset from the given address.  If blank,
1068  * @vaddr always equals @laddr + LOAD_OFFSET.
1069  *
1070  * @phdr defines the output PHDR to use if not blank.  Be warned that
1071  * output PHDR is sticky.  If @phdr is specified, the next output
1072  * section in the linker script will go there too.  @phdr should have
1073  * a leading colon.
1074  *
1075  * Note that this macros defines __per_cpu_load as an absolute symbol.
1076  * If there is no need to put the percpu section at a predetermined
1077  * address, use PERCPU_SECTION.
1078  */
1079 #define PERCPU_VADDR(cacheline, vaddr, phdr)				\
1080 	__per_cpu_load = .;						\
1081 	.data..percpu vaddr : AT(__per_cpu_load - LOAD_OFFSET) {	\
1082 		PERCPU_INPUT(cacheline)					\
1083 	} phdr								\
1084 	. = __per_cpu_load + SIZEOF(.data..percpu);
1085 
1086 /**
1087  * PERCPU_SECTION - define output section for percpu area, simple version
1088  * @cacheline: cacheline size
1089  *
1090  * Align to PAGE_SIZE and outputs output section for percpu area.  This
1091  * macro doesn't manipulate @vaddr or @phdr and __per_cpu_load and
1092  * __per_cpu_start will be identical.
1093  *
1094  * This macro is equivalent to ALIGN(PAGE_SIZE); PERCPU_VADDR(@cacheline,,)
1095  * except that __per_cpu_load is defined as a relative symbol against
1096  * .data..percpu which is required for relocatable x86_32 configuration.
1097  */
1098 #define PERCPU_SECTION(cacheline)					\
1099 	. = ALIGN(PAGE_SIZE);						\
1100 	.data..percpu	: AT(ADDR(.data..percpu) - LOAD_OFFSET) {	\
1101 		__per_cpu_load = .;					\
1102 		PERCPU_INPUT(cacheline)					\
1103 	}
1104 
1105 
1106 /*
1107  * Definition of the high level *_SECTION macros
1108  * They will fit only a subset of the architectures
1109  */
1110 
1111 
1112 /*
1113  * Writeable data.
1114  * All sections are combined in a single .data section.
1115  * The sections following CONSTRUCTORS are arranged so their
1116  * typical alignment matches.
1117  * A cacheline is typical/always less than a PAGE_SIZE so
1118  * the sections that has this restriction (or similar)
1119  * is located before the ones requiring PAGE_SIZE alignment.
1120  * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which
1121  * matches the requirement of PAGE_ALIGNED_DATA.
1122  *
1123  * use 0 as page_align if page_aligned data is not used */
1124 #define RW_DATA(cacheline, pagealigned, inittask)			\
1125 	. = ALIGN(PAGE_SIZE);						\
1126 	.data : AT(ADDR(.data) - LOAD_OFFSET) {				\
1127 		INIT_TASK_DATA(inittask)				\
1128 		NOSAVE_DATA						\
1129 		PAGE_ALIGNED_DATA(pagealigned)				\
1130 		CACHELINE_ALIGNED_DATA(cacheline)			\
1131 		READ_MOSTLY_DATA(cacheline)				\
1132 		DATA_DATA						\
1133 		CONSTRUCTORS						\
1134 	}								\
1135 	BUG_TABLE							\
1136 
1137 #define INIT_TEXT_SECTION(inittext_align)				\
1138 	. = ALIGN(inittext_align);					\
1139 	.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {		\
1140 		_sinittext = .;						\
1141 		INIT_TEXT						\
1142 		_einittext = .;						\
1143 	}
1144 
1145 #define INIT_DATA_SECTION(initsetup_align)				\
1146 	.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {		\
1147 		INIT_DATA						\
1148 		INIT_SETUP(initsetup_align)				\
1149 		INIT_CALLS						\
1150 		CON_INITCALL						\
1151 		INIT_RAM_FS						\
1152 	}
1153 
1154 #define BSS_SECTION(sbss_align, bss_align, stop_align)			\
1155 	. = ALIGN(sbss_align);						\
1156 	__bss_start = .;						\
1157 	SBSS(sbss_align)						\
1158 	BSS(bss_align)							\
1159 	. = ALIGN(stop_align);						\
1160 	__bss_stop = .;
1161