File Index
Files and directories
Sign in
FILE

vmlinux.lds.h

File preview with syntax highlighting.

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