Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Helper macros to support writing architecture specific
0003  * linker scripts.
0004  *
0005  * A minimal linker scripts has following content:
0006  * [This is a sample, architectures may have special requiriements]
0007  *
0008  * OUTPUT_FORMAT(...)
0009  * OUTPUT_ARCH(...)
0010  * ENTRY(...)
0011  * SECTIONS
0012  * {
0013  *  . = START;
0014  *  __init_begin = .;
0015  *  HEAD_TEXT_SECTION
0016  *  INIT_TEXT_SECTION(PAGE_SIZE)
0017  *  INIT_DATA_SECTION(...)
0018  *  PERCPU_SECTION(CACHELINE_SIZE)
0019  *  __init_end = .;
0020  *
0021  *  _stext = .;
0022  *  TEXT_SECTION = 0
0023  *  _etext = .;
0024  *
0025  *      _sdata = .;
0026  *  RO_DATA(PAGE_SIZE)
0027  *  RW_DATA(...)
0028  *  _edata = .;
0029  *
0030  *  EXCEPTION_TABLE(...)
0031  *
0032  *  BSS_SECTION(0, 0, 0)
0033  *  _end = .;
0034  *
0035  *  STABS_DEBUG
0036  *  DWARF_DEBUG
0037  *  ELF_DETAILS
0038  *
0039  *  DISCARDS        // must be the last
0040  * }
0041  *
0042  * [__init_begin, __init_end] is the init section that may be freed after init
0043  *  // __init_begin and __init_end should be page aligned, so that we can
0044  *  // free the whole .init memory
0045  * [_stext, _etext] is the text section
0046  * [_sdata, _edata] is the data section
0047  *
0048  * Some of the included output section have their own set of constants.
0049  * Examples are: [__initramfs_start, __initramfs_end] for initramfs and
0050  *               [__nosave_begin, __nosave_end] for the nosave data
0051  */
0052 
0053 #ifndef LOAD_OFFSET
0054 #define LOAD_OFFSET 0
0055 #endif
0056 
0057 /*
0058  * Only some architectures want to have the .notes segment visible in
0059  * a separate PT_NOTE ELF Program Header. When this happens, it needs
0060  * to be visible in both the kernel text's PT_LOAD and the PT_NOTE
0061  * Program Headers. In this case, though, the PT_LOAD needs to be made
0062  * the default again so that all the following sections don't also end
0063  * up in the PT_NOTE Program Header.
0064  */
0065 #ifdef EMITS_PT_NOTE
0066 #define NOTES_HEADERS       :text :note
0067 #define NOTES_HEADERS_RESTORE   __restore_ph : { *(.__restore_ph) } :text
0068 #else
0069 #define NOTES_HEADERS
0070 #define NOTES_HEADERS_RESTORE
0071 #endif
0072 
0073 /*
0074  * Some architectures have non-executable read-only exception tables.
0075  * They can be added to the RO_DATA segment by specifying their desired
0076  * alignment.
0077  */
0078 #ifdef RO_EXCEPTION_TABLE_ALIGN
0079 #define RO_EXCEPTION_TABLE  EXCEPTION_TABLE(RO_EXCEPTION_TABLE_ALIGN)
0080 #else
0081 #define RO_EXCEPTION_TABLE
0082 #endif
0083 
0084 /* Align . to a 8 byte boundary equals to maximum function alignment. */
0085 #define ALIGN_FUNCTION()  . = ALIGN(8)
0086 
0087 /*
0088  * LD_DEAD_CODE_DATA_ELIMINATION option enables -fdata-sections, which
0089  * generates .data.identifier sections, which need to be pulled in with
0090  * .data. We don't want to pull in .data..other sections, which Linux
0091  * has defined. Same for text and bss.
0092  *
0093  * With LTO_CLANG, the linker also splits sections by default, so we need
0094  * these macros to combine the sections during the final link.
0095  *
0096  * RODATA_MAIN is not used because existing code already defines .rodata.x
0097  * sections to be brought in with rodata.
0098  */
0099 #if defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || defined(CONFIG_LTO_CLANG)
0100 #define TEXT_MAIN .text .text.[0-9a-zA-Z_]*
0101 #define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* .data.$__unnamed_* .data.$L*
0102 #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]*
0103 #define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L*
0104 #define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral*
0105 #define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]*
0106 #else
0107 #define TEXT_MAIN .text
0108 #define DATA_MAIN .data
0109 #define SDATA_MAIN .sdata
0110 #define RODATA_MAIN .rodata
0111 #define BSS_MAIN .bss
0112 #define SBSS_MAIN .sbss
0113 #endif
0114 
0115 /*
0116  * GCC 4.5 and later have a 32 bytes section alignment for structures.
0117  * Except GCC 4.9, that feels the need to align on 64 bytes.
0118  */
0119 #define STRUCT_ALIGNMENT 32
0120 #define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT)
0121 
0122 /*
0123  * The order of the sched class addresses are important, as they are
0124  * used to determine the order of the priority of each sched class in
0125  * relation to each other.
0126  */
0127 #define SCHED_DATA              \
0128     STRUCT_ALIGN();             \
0129     __sched_class_highest = .;      \
0130     *(__stop_sched_class)           \
0131     *(__dl_sched_class)         \
0132     *(__rt_sched_class)         \
0133     *(__fair_sched_class)           \
0134     *(__idle_sched_class)           \
0135     __sched_class_lowest = .;
0136 
0137 /* The actual configuration determine if the init/exit sections
0138  * are handled as text/data or they can be discarded (which
0139  * often happens at runtime)
0140  */
0141 #ifdef CONFIG_HOTPLUG_CPU
0142 #define CPU_KEEP(sec)    *(.cpu##sec)
0143 #define CPU_DISCARD(sec)
0144 #else
0145 #define CPU_KEEP(sec)
0146 #define CPU_DISCARD(sec) *(.cpu##sec)
0147 #endif
0148 
0149 #if defined(CONFIG_MEMORY_HOTPLUG)
0150 #define MEM_KEEP(sec)    *(.mem##sec)
0151 #define MEM_DISCARD(sec)
0152 #else
0153 #define MEM_KEEP(sec)
0154 #define MEM_DISCARD(sec) *(.mem##sec)
0155 #endif
0156 
0157 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
0158 /*
0159  * The ftrace call sites are logged to a section whose name depends on the
0160  * compiler option used. A given kernel image will only use one, AKA
0161  * FTRACE_CALLSITE_SECTION. We capture all of them here to avoid header
0162  * dependencies for FTRACE_CALLSITE_SECTION's definition.
0163  *
0164  * Need to also make ftrace_stub_graph point to ftrace_stub
0165  * so that the same stub location may have different protocols
0166  * and not mess up with C verifiers.
0167  *
0168  * ftrace_ops_list_func will be defined as arch_ftrace_ops_list_func
0169  * as some archs will have a different prototype for that function
0170  * but ftrace_ops_list_func() will have a single prototype.
0171  */
0172 #define MCOUNT_REC()    . = ALIGN(8);               \
0173             __start_mcount_loc = .;         \
0174             KEEP(*(__mcount_loc))           \
0175             KEEP(*(__patchable_function_entries))   \
0176             __stop_mcount_loc = .;          \
0177             ftrace_stub_graph = ftrace_stub;    \
0178             ftrace_ops_list_func = arch_ftrace_ops_list_func;
0179 #else
0180 # ifdef CONFIG_FUNCTION_TRACER
0181 #  define MCOUNT_REC()  ftrace_stub_graph = ftrace_stub;    \
0182             ftrace_ops_list_func = arch_ftrace_ops_list_func;
0183 # else
0184 #  define MCOUNT_REC()
0185 # endif
0186 #endif
0187 
0188 #ifdef CONFIG_TRACE_BRANCH_PROFILING
0189 #define LIKELY_PROFILE()    __start_annotated_branch_profile = .;   \
0190                 KEEP(*(_ftrace_annotated_branch))   \
0191                 __stop_annotated_branch_profile = .;
0192 #else
0193 #define LIKELY_PROFILE()
0194 #endif
0195 
0196 #ifdef CONFIG_PROFILE_ALL_BRANCHES
0197 #define BRANCH_PROFILE()    __start_branch_profile = .;     \
0198                 KEEP(*(_ftrace_branch))         \
0199                 __stop_branch_profile = .;
0200 #else
0201 #define BRANCH_PROFILE()
0202 #endif
0203 
0204 #ifdef CONFIG_KPROBES
0205 #define KPROBE_BLACKLIST()  . = ALIGN(8);                     \
0206                 __start_kprobe_blacklist = .;             \
0207                 KEEP(*(_kprobe_blacklist))            \
0208                 __stop_kprobe_blacklist = .;
0209 #else
0210 #define KPROBE_BLACKLIST()
0211 #endif
0212 
0213 #ifdef CONFIG_FUNCTION_ERROR_INJECTION
0214 #define ERROR_INJECT_WHITELIST()    STRUCT_ALIGN();               \
0215             __start_error_injection_whitelist = .;            \
0216             KEEP(*(_error_injection_whitelist))           \
0217             __stop_error_injection_whitelist = .;
0218 #else
0219 #define ERROR_INJECT_WHITELIST()
0220 #endif
0221 
0222 #ifdef CONFIG_EVENT_TRACING
0223 #define FTRACE_EVENTS() . = ALIGN(8);                   \
0224             __start_ftrace_events = .;          \
0225             KEEP(*(_ftrace_events))             \
0226             __stop_ftrace_events = .;           \
0227             __start_ftrace_eval_maps = .;           \
0228             KEEP(*(_ftrace_eval_map))           \
0229             __stop_ftrace_eval_maps = .;
0230 #else
0231 #define FTRACE_EVENTS()
0232 #endif
0233 
0234 #ifdef CONFIG_TRACING
0235 #define TRACE_PRINTKS()  __start___trace_bprintk_fmt = .;      \
0236              KEEP(*(__trace_printk_fmt)) /* Trace_printk fmt' pointer */ \
0237              __stop___trace_bprintk_fmt = .;
0238 #define TRACEPOINT_STR() __start___tracepoint_str = .;  \
0239              KEEP(*(__tracepoint_str)) /* Trace_printk fmt' pointer */ \
0240              __stop___tracepoint_str = .;
0241 #else
0242 #define TRACE_PRINTKS()
0243 #define TRACEPOINT_STR()
0244 #endif
0245 
0246 #ifdef CONFIG_FTRACE_SYSCALLS
0247 #define TRACE_SYSCALLS() . = ALIGN(8);                  \
0248              __start_syscalls_metadata = .;         \
0249              KEEP(*(__syscalls_metadata))           \
0250              __stop_syscalls_metadata = .;
0251 #else
0252 #define TRACE_SYSCALLS()
0253 #endif
0254 
0255 #ifdef CONFIG_BPF_EVENTS
0256 #define BPF_RAW_TP() STRUCT_ALIGN();                    \
0257              __start__bpf_raw_tp = .;           \
0258              KEEP(*(__bpf_raw_tp_map))          \
0259              __stop__bpf_raw_tp = .;
0260 #else
0261 #define BPF_RAW_TP()
0262 #endif
0263 
0264 #ifdef CONFIG_SERIAL_EARLYCON
0265 #define EARLYCON_TABLE() . = ALIGN(8);              \
0266              __earlycon_table = .;          \
0267              KEEP(*(__earlycon_table))      \
0268              __earlycon_table_end = .;
0269 #else
0270 #define EARLYCON_TABLE()
0271 #endif
0272 
0273 #ifdef CONFIG_SECURITY
0274 #define LSM_TABLE() . = ALIGN(8);                   \
0275             __start_lsm_info = .;               \
0276             KEEP(*(.lsm_info.init))             \
0277             __end_lsm_info = .;
0278 #define EARLY_LSM_TABLE()   . = ALIGN(8);               \
0279             __start_early_lsm_info = .;         \
0280             KEEP(*(.early_lsm_info.init))           \
0281             __end_early_lsm_info = .;
0282 #else
0283 #define LSM_TABLE()
0284 #define EARLY_LSM_TABLE()
0285 #endif
0286 
0287 #define ___OF_TABLE(cfg, name)  _OF_TABLE_##cfg(name)
0288 #define __OF_TABLE(cfg, name)   ___OF_TABLE(cfg, name)
0289 #define OF_TABLE(cfg, name) __OF_TABLE(IS_ENABLED(cfg), name)
0290 #define _OF_TABLE_0(name)
0291 #define _OF_TABLE_1(name)                       \
0292     . = ALIGN(8);                           \
0293     __##name##_of_table = .;                    \
0294     KEEP(*(__##name##_of_table))                    \
0295     KEEP(*(__##name##_of_table_end))
0296 
0297 #define TIMER_OF_TABLES()   OF_TABLE(CONFIG_TIMER_OF, timer)
0298 #define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip)
0299 #define CLK_OF_TABLES()     OF_TABLE(CONFIG_COMMON_CLK, clk)
0300 #define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem)
0301 #define CPU_METHOD_OF_TABLES()  OF_TABLE(CONFIG_SMP, cpu_method)
0302 #define CPUIDLE_METHOD_OF_TABLES() OF_TABLE(CONFIG_CPU_IDLE, cpuidle_method)
0303 
0304 #ifdef CONFIG_ACPI
0305 #define ACPI_PROBE_TABLE(name)                      \
0306     . = ALIGN(8);                           \
0307     __##name##_acpi_probe_table = .;                \
0308     KEEP(*(__##name##_acpi_probe_table))                \
0309     __##name##_acpi_probe_table_end = .;
0310 #else
0311 #define ACPI_PROBE_TABLE(name)
0312 #endif
0313 
0314 #ifdef CONFIG_THERMAL
0315 #define THERMAL_TABLE(name)                     \
0316     . = ALIGN(8);                           \
0317     __##name##_thermal_table = .;                   \
0318     KEEP(*(__##name##_thermal_table))               \
0319     __##name##_thermal_table_end = .;
0320 #else
0321 #define THERMAL_TABLE(name)
0322 #endif
0323 
0324 #define KERNEL_DTB()                            \
0325     STRUCT_ALIGN();                         \
0326     __dtb_start = .;                        \
0327     KEEP(*(.dtb.init.rodata))                   \
0328     __dtb_end = .;
0329 
0330 /*
0331  * .data section
0332  */
0333 #define DATA_DATA                           \
0334     *(.xiptext)                         \
0335     *(DATA_MAIN)                            \
0336     *(.ref.data)                            \
0337     *(.data..shared_aligned) /* percpu related */           \
0338     MEM_KEEP(init.data*)                        \
0339     MEM_KEEP(exit.data*)                        \
0340     *(.data.unlikely)                       \
0341     __start_once = .;                       \
0342     *(.data.once)                           \
0343     __end_once = .;                         \
0344     STRUCT_ALIGN();                         \
0345     *(__tracepoints)                        \
0346     /* implement dynamic printk debug */                \
0347     . = ALIGN(8);                           \
0348     __start___dyndbg = .;                       \
0349     KEEP(*(__dyndbg))                       \
0350     __stop___dyndbg = .;                        \
0351     LIKELY_PROFILE()                            \
0352     BRANCH_PROFILE()                        \
0353     TRACE_PRINTKS()                         \
0354     BPF_RAW_TP()                            \
0355     TRACEPOINT_STR()
0356 
0357 /*
0358  * Data section helpers
0359  */
0360 #define NOSAVE_DATA                         \
0361     . = ALIGN(PAGE_SIZE);                       \
0362     __nosave_begin = .;                     \
0363     *(.data..nosave)                        \
0364     . = ALIGN(PAGE_SIZE);                       \
0365     __nosave_end = .;
0366 
0367 #define PAGE_ALIGNED_DATA(page_align)                   \
0368     . = ALIGN(page_align);                      \
0369     *(.data..page_aligned)                      \
0370     . = ALIGN(page_align);
0371 
0372 #define READ_MOSTLY_DATA(align)                     \
0373     . = ALIGN(align);                       \
0374     *(.data..read_mostly)                       \
0375     . = ALIGN(align);
0376 
0377 #define CACHELINE_ALIGNED_DATA(align)                   \
0378     . = ALIGN(align);                       \
0379     *(.data..cacheline_aligned)
0380 
0381 #define INIT_TASK_DATA(align)                       \
0382     . = ALIGN(align);                       \
0383     __start_init_task = .;                      \
0384     init_thread_union = .;                      \
0385     init_stack = .;                         \
0386     KEEP(*(.data..init_task))                   \
0387     KEEP(*(.data..init_thread_info))                \
0388     . = __start_init_task + THREAD_SIZE;                \
0389     __end_init_task = .;
0390 
0391 #define JUMP_TABLE_DATA                         \
0392     . = ALIGN(8);                           \
0393     __start___jump_table = .;                   \
0394     KEEP(*(__jump_table))                       \
0395     __stop___jump_table = .;
0396 
0397 #ifdef CONFIG_HAVE_STATIC_CALL_INLINE
0398 #define STATIC_CALL_DATA                        \
0399     . = ALIGN(8);                           \
0400     __start_static_call_sites = .;                  \
0401     KEEP(*(.static_call_sites))                 \
0402     __stop_static_call_sites = .;                   \
0403     __start_static_call_tramp_key = .;              \
0404     KEEP(*(.static_call_tramp_key))                 \
0405     __stop_static_call_tramp_key = .;
0406 #else
0407 #define STATIC_CALL_DATA
0408 #endif
0409 
0410 /*
0411  * Allow architectures to handle ro_after_init data on their
0412  * own by defining an empty RO_AFTER_INIT_DATA.
0413  */
0414 #ifndef RO_AFTER_INIT_DATA
0415 #define RO_AFTER_INIT_DATA                      \
0416     . = ALIGN(8);                           \
0417     __start_ro_after_init = .;                  \
0418     *(.data..ro_after_init)                     \
0419     JUMP_TABLE_DATA                         \
0420     STATIC_CALL_DATA                        \
0421     __end_ro_after_init = .;
0422 #endif
0423 
0424 /*
0425  * Read only Data
0426  */
0427 #define RO_DATA(align)                          \
0428     . = ALIGN((align));                     \
0429     .rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {       \
0430         __start_rodata = .;                 \
0431         *(.rodata) *(.rodata.*)                 \
0432         SCHED_DATA                      \
0433         RO_AFTER_INIT_DATA  /* Read only after init */  \
0434         . = ALIGN(8);                       \
0435         __start___tracepoints_ptrs = .;             \
0436         KEEP(*(__tracepoints_ptrs)) /* Tracepoints: pointer array */ \
0437         __stop___tracepoints_ptrs = .;              \
0438         *(__tracepoints_strings)/* Tracepoints: strings */  \
0439     }                               \
0440                                     \
0441     .rodata1          : AT(ADDR(.rodata1) - LOAD_OFFSET) {      \
0442         *(.rodata1)                     \
0443     }                               \
0444                                     \
0445     /* PCI quirks */                        \
0446     .pci_fixup        : AT(ADDR(.pci_fixup) - LOAD_OFFSET) {    \
0447         __start_pci_fixups_early = .;               \
0448         KEEP(*(.pci_fixup_early))               \
0449         __end_pci_fixups_early = .;             \
0450         __start_pci_fixups_header = .;              \
0451         KEEP(*(.pci_fixup_header))              \
0452         __end_pci_fixups_header = .;                \
0453         __start_pci_fixups_final = .;               \
0454         KEEP(*(.pci_fixup_final))               \
0455         __end_pci_fixups_final = .;             \
0456         __start_pci_fixups_enable = .;              \
0457         KEEP(*(.pci_fixup_enable))              \
0458         __end_pci_fixups_enable = .;                \
0459         __start_pci_fixups_resume = .;              \
0460         KEEP(*(.pci_fixup_resume))              \
0461         __end_pci_fixups_resume = .;                \
0462         __start_pci_fixups_resume_early = .;            \
0463         KEEP(*(.pci_fixup_resume_early))            \
0464         __end_pci_fixups_resume_early = .;          \
0465         __start_pci_fixups_suspend = .;             \
0466         KEEP(*(.pci_fixup_suspend))             \
0467         __end_pci_fixups_suspend = .;               \
0468         __start_pci_fixups_suspend_late = .;            \
0469         KEEP(*(.pci_fixup_suspend_late))            \
0470         __end_pci_fixups_suspend_late = .;          \
0471     }                               \
0472                                     \
0473     FW_LOADER_BUILT_IN_DATA                     \
0474     TRACEDATA                           \
0475                                     \
0476     PRINTK_INDEX                            \
0477                                     \
0478     /* Kernel symbol table: Normal symbols */           \
0479     __ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {     \
0480         __start___ksymtab = .;                  \
0481         KEEP(*(SORT(___ksymtab+*)))             \
0482         __stop___ksymtab = .;                   \
0483     }                               \
0484                                     \
0485     /* Kernel symbol table: GPL-only symbols */         \
0486     __ksymtab_gpl     : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \
0487         __start___ksymtab_gpl = .;              \
0488         KEEP(*(SORT(___ksymtab_gpl+*)))             \
0489         __stop___ksymtab_gpl = .;               \
0490     }                               \
0491                                     \
0492     /* Kernel symbol table: Normal symbols */           \
0493     __kcrctab         : AT(ADDR(__kcrctab) - LOAD_OFFSET) {     \
0494         __start___kcrctab = .;                  \
0495         KEEP(*(SORT(___kcrctab+*)))             \
0496         __stop___kcrctab = .;                   \
0497     }                               \
0498                                     \
0499     /* Kernel symbol table: GPL-only symbols */         \
0500     __kcrctab_gpl     : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \
0501         __start___kcrctab_gpl = .;              \
0502         KEEP(*(SORT(___kcrctab_gpl+*)))             \
0503         __stop___kcrctab_gpl = .;               \
0504     }                               \
0505                                     \
0506     /* Kernel symbol table: strings */              \
0507         __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
0508         *(__ksymtab_strings)                    \
0509     }                               \
0510                                     \
0511     /* __*init sections */                      \
0512     __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) {     \
0513         *(.ref.rodata)                      \
0514         MEM_KEEP(init.rodata)                   \
0515         MEM_KEEP(exit.rodata)                   \
0516     }                               \
0517                                     \
0518     /* Built-in module parameters. */               \
0519     __param : AT(ADDR(__param) - LOAD_OFFSET) {         \
0520         __start___param = .;                    \
0521         KEEP(*(__param))                    \
0522         __stop___param = .;                 \
0523     }                               \
0524                                     \
0525     /* Built-in module versions. */                 \
0526     __modver : AT(ADDR(__modver) - LOAD_OFFSET) {           \
0527         __start___modver = .;                   \
0528         KEEP(*(__modver))                   \
0529         __stop___modver = .;                    \
0530     }                               \
0531                                     \
0532     RO_EXCEPTION_TABLE                      \
0533     NOTES                               \
0534     BTF                             \
0535                                     \
0536     . = ALIGN((align));                     \
0537     __end_rodata = .;
0538 
0539 
0540 /*
0541  * .text..L.cfi.jumptable.* contain Control-Flow Integrity (CFI)
0542  * jump table entries.
0543  */
0544 #ifdef CONFIG_CFI_CLANG
0545 #define TEXT_CFI_JT                         \
0546         ALIGN_FUNCTION();                   \
0547         __cfi_jt_start = .;                 \
0548         *(.text..L.cfi.jumptable .text..L.cfi.jumptable.*)  \
0549         __cfi_jt_end = .;
0550 #else
0551 #define TEXT_CFI_JT
0552 #endif
0553 
0554 /*
0555  * Non-instrumentable text section
0556  */
0557 #define NOINSTR_TEXT                            \
0558         ALIGN_FUNCTION();                   \
0559         __noinstr_text_start = .;               \
0560         *(.noinstr.text)                    \
0561         __noinstr_text_end = .;
0562 
0563 /*
0564  * .text section. Map to function alignment to avoid address changes
0565  * during second ld run in second ld pass when generating System.map
0566  *
0567  * TEXT_MAIN here will match .text.fixup and .text.unlikely if dead
0568  * code elimination is enabled, so these sections should be converted
0569  * to use ".." first.
0570  */
0571 #define TEXT_TEXT                           \
0572         ALIGN_FUNCTION();                   \
0573         *(.text.hot .text.hot.*)                \
0574         *(TEXT_MAIN .text.fixup)                \
0575         *(.text.unlikely .text.unlikely.*)          \
0576         *(.text.unknown .text.unknown.*)            \
0577         NOINSTR_TEXT                        \
0578         *(.text..refcount)                  \
0579         *(.ref.text)                        \
0580         *(.text.asan.* .text.tsan.*)                \
0581         TEXT_CFI_JT                     \
0582     MEM_KEEP(init.text*)                        \
0583     MEM_KEEP(exit.text*)                        \
0584 
0585 
0586 /* sched.text is aling to function alignment to secure we have same
0587  * address even at second ld pass when generating System.map */
0588 #define SCHED_TEXT                          \
0589         ALIGN_FUNCTION();                   \
0590         __sched_text_start = .;                 \
0591         *(.sched.text)                      \
0592         __sched_text_end = .;
0593 
0594 /* spinlock.text is aling to function alignment to secure we have same
0595  * address even at second ld pass when generating System.map */
0596 #define LOCK_TEXT                           \
0597         ALIGN_FUNCTION();                   \
0598         __lock_text_start = .;                  \
0599         *(.spinlock.text)                   \
0600         __lock_text_end = .;
0601 
0602 #define CPUIDLE_TEXT                            \
0603         ALIGN_FUNCTION();                   \
0604         __cpuidle_text_start = .;               \
0605         *(.cpuidle.text)                    \
0606         __cpuidle_text_end = .;
0607 
0608 #define KPROBES_TEXT                            \
0609         ALIGN_FUNCTION();                   \
0610         __kprobes_text_start = .;               \
0611         *(.kprobes.text)                    \
0612         __kprobes_text_end = .;
0613 
0614 #define ENTRY_TEXT                          \
0615         ALIGN_FUNCTION();                   \
0616         __entry_text_start = .;                 \
0617         *(.entry.text)                      \
0618         __entry_text_end = .;
0619 
0620 #define IRQENTRY_TEXT                           \
0621         ALIGN_FUNCTION();                   \
0622         __irqentry_text_start = .;              \
0623         *(.irqentry.text)                   \
0624         __irqentry_text_end = .;
0625 
0626 #define SOFTIRQENTRY_TEXT                       \
0627         ALIGN_FUNCTION();                   \
0628         __softirqentry_text_start = .;              \
0629         *(.softirqentry.text)                   \
0630         __softirqentry_text_end = .;
0631 
0632 #define STATIC_CALL_TEXT                        \
0633         ALIGN_FUNCTION();                   \
0634         __static_call_text_start = .;               \
0635         *(.static_call.text)                    \
0636         __static_call_text_end = .;
0637 
0638 /* Section used for early init (in .S files) */
0639 #define HEAD_TEXT  KEEP(*(.head.text))
0640 
0641 #define HEAD_TEXT_SECTION                           \
0642     .head.text : AT(ADDR(.head.text) - LOAD_OFFSET) {       \
0643         HEAD_TEXT                       \
0644     }
0645 
0646 /*
0647  * Exception table
0648  */
0649 #define EXCEPTION_TABLE(align)                      \
0650     . = ALIGN(align);                       \
0651     __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {       \
0652         __start___ex_table = .;                 \
0653         KEEP(*(__ex_table))                 \
0654         __stop___ex_table = .;                  \
0655     }
0656 
0657 /*
0658  * .BTF
0659  */
0660 #ifdef CONFIG_DEBUG_INFO_BTF
0661 #define BTF                             \
0662     .BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {               \
0663         __start_BTF = .;                    \
0664         KEEP(*(.BTF))                       \
0665         __stop_BTF = .;                     \
0666     }                               \
0667     . = ALIGN(4);                           \
0668     .BTF_ids : AT(ADDR(.BTF_ids) - LOAD_OFFSET) {           \
0669         *(.BTF_ids)                     \
0670     }
0671 #else
0672 #define BTF
0673 #endif
0674 
0675 /*
0676  * Init task
0677  */
0678 #define INIT_TASK_DATA_SECTION(align)                   \
0679     . = ALIGN(align);                       \
0680     .data..init_task :  AT(ADDR(.data..init_task) - LOAD_OFFSET) {  \
0681         INIT_TASK_DATA(align)                   \
0682     }
0683 
0684 #ifdef CONFIG_CONSTRUCTORS
0685 #define KERNEL_CTORS()  . = ALIGN(8);              \
0686             __ctors_start = .;         \
0687             KEEP(*(SORT(.ctors.*)))        \
0688             KEEP(*(.ctors))            \
0689             KEEP(*(SORT(.init_array.*)))       \
0690             KEEP(*(.init_array))           \
0691             __ctors_end = .;
0692 #else
0693 #define KERNEL_CTORS()
0694 #endif
0695 
0696 /* init and exit section handling */
0697 #define INIT_DATA                           \
0698     KEEP(*(SORT(___kentry+*)))                  \
0699     *(.init.data init.data.*)                   \
0700     MEM_DISCARD(init.data*)                     \
0701     KERNEL_CTORS()                          \
0702     MCOUNT_REC()                            \
0703     *(.init.rodata .init.rodata.*)                  \
0704     FTRACE_EVENTS()                         \
0705     TRACE_SYSCALLS()                        \
0706     KPROBE_BLACKLIST()                      \
0707     ERROR_INJECT_WHITELIST()                    \
0708     MEM_DISCARD(init.rodata)                    \
0709     CLK_OF_TABLES()                         \
0710     RESERVEDMEM_OF_TABLES()                     \
0711     TIMER_OF_TABLES()                       \
0712     CPU_METHOD_OF_TABLES()                      \
0713     CPUIDLE_METHOD_OF_TABLES()                  \
0714     KERNEL_DTB()                            \
0715     IRQCHIP_OF_MATCH_TABLE()                    \
0716     ACPI_PROBE_TABLE(irqchip)                   \
0717     ACPI_PROBE_TABLE(timer)                     \
0718     THERMAL_TABLE(governor)                     \
0719     EARLYCON_TABLE()                        \
0720     LSM_TABLE()                         \
0721     EARLY_LSM_TABLE()                       \
0722     KUNIT_TABLE()
0723 
0724 #define INIT_TEXT                           \
0725     *(.init.text .init.text.*)                  \
0726     *(.text.startup)                        \
0727     MEM_DISCARD(init.text*)
0728 
0729 #define EXIT_DATA                           \
0730     *(.exit.data .exit.data.*)                  \
0731     *(.fini_array .fini_array.*)                    \
0732     *(.dtors .dtors.*)                      \
0733     MEM_DISCARD(exit.data*)                     \
0734     MEM_DISCARD(exit.rodata*)
0735 
0736 #define EXIT_TEXT                           \
0737     *(.exit.text)                           \
0738     *(.text.exit)                           \
0739     MEM_DISCARD(exit.text)
0740 
0741 #define EXIT_CALL                           \
0742     *(.exitcall.exit)
0743 
0744 /*
0745  * bss (Block Started by Symbol) - uninitialized data
0746  * zeroed during startup
0747  */
0748 #define SBSS(sbss_align)                        \
0749     . = ALIGN(sbss_align);                      \
0750     .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {             \
0751         *(.dynsbss)                     \
0752         *(SBSS_MAIN)                        \
0753         *(.scommon)                     \
0754     }
0755 
0756 /*
0757  * Allow archectures to redefine BSS_FIRST_SECTIONS to add extra
0758  * sections to the front of bss.
0759  */
0760 #ifndef BSS_FIRST_SECTIONS
0761 #define BSS_FIRST_SECTIONS
0762 #endif
0763 
0764 #define BSS(bss_align)                          \
0765     . = ALIGN(bss_align);                       \
0766     .bss : AT(ADDR(.bss) - LOAD_OFFSET) {               \
0767         BSS_FIRST_SECTIONS                  \
0768         . = ALIGN(PAGE_SIZE);                   \
0769         *(.bss..page_aligned)                   \
0770         . = ALIGN(PAGE_SIZE);                   \
0771         *(.dynbss)                      \
0772         *(BSS_MAIN)                     \
0773         *(COMMON)                       \
0774     }
0775 
0776 /*
0777  * DWARF debug sections.
0778  * Symbols in the DWARF debugging sections are relative to
0779  * the beginning of the section so we begin them at 0.
0780  */
0781 #define DWARF_DEBUG                         \
0782         /* DWARF 1 */                       \
0783         .debug          0 : { *(.debug) }           \
0784         .line           0 : { *(.line) }            \
0785         /* GNU DWARF 1 extensions */                \
0786         .debug_srcinfo  0 : { *(.debug_srcinfo) }       \
0787         .debug_sfnames  0 : { *(.debug_sfnames) }       \
0788         /* DWARF 1.1 and DWARF 2 */             \
0789         .debug_aranges  0 : { *(.debug_aranges) }       \
0790         .debug_pubnames 0 : { *(.debug_pubnames) }      \
0791         /* DWARF 2 */                       \
0792         .debug_info     0 : { *(.debug_info         \
0793                 .gnu.linkonce.wi.*) }           \
0794         .debug_abbrev   0 : { *(.debug_abbrev) }        \
0795         .debug_line     0 : { *(.debug_line) }          \
0796         .debug_frame    0 : { *(.debug_frame) }         \
0797         .debug_str      0 : { *(.debug_str) }           \
0798         .debug_loc      0 : { *(.debug_loc) }           \
0799         .debug_macinfo  0 : { *(.debug_macinfo) }       \
0800         .debug_pubtypes 0 : { *(.debug_pubtypes) }      \
0801         /* DWARF 3 */                       \
0802         .debug_ranges   0 : { *(.debug_ranges) }        \
0803         /* SGI/MIPS DWARF 2 extensions */           \
0804         .debug_weaknames 0 : { *(.debug_weaknames) }        \
0805         .debug_funcnames 0 : { *(.debug_funcnames) }        \
0806         .debug_typenames 0 : { *(.debug_typenames) }        \
0807         .debug_varnames  0 : { *(.debug_varnames) }     \
0808         /* GNU DWARF 2 extensions */                \
0809         .debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }  \
0810         .debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }  \
0811         /* DWARF 4 */                       \
0812         .debug_types    0 : { *(.debug_types) }         \
0813         /* DWARF 5 */                       \
0814         .debug_addr 0 : { *(.debug_addr) }          \
0815         .debug_line_str 0 : { *(.debug_line_str) }      \
0816         .debug_loclists 0 : { *(.debug_loclists) }      \
0817         .debug_macro    0 : { *(.debug_macro) }         \
0818         .debug_names    0 : { *(.debug_names) }         \
0819         .debug_rnglists 0 : { *(.debug_rnglists) }      \
0820         .debug_str_offsets  0 : { *(.debug_str_offsets) }
0821 
0822 /* Stabs debugging sections. */
0823 #define STABS_DEBUG                         \
0824         .stab 0 : { *(.stab) }                  \
0825         .stabstr 0 : { *(.stabstr) }                \
0826         .stab.excl 0 : { *(.stab.excl) }            \
0827         .stab.exclstr 0 : { *(.stab.exclstr) }          \
0828         .stab.index 0 : { *(.stab.index) }          \
0829         .stab.indexstr 0 : { *(.stab.indexstr) }
0830 
0831 /* Required sections not related to debugging. */
0832 #define ELF_DETAILS                         \
0833         .comment 0 : { *(.comment) }                \
0834         .symtab 0 : { *(.symtab) }              \
0835         .strtab 0 : { *(.strtab) }              \
0836         .shstrtab 0 : { *(.shstrtab) }
0837 
0838 #ifdef CONFIG_GENERIC_BUG
0839 #define BUG_TABLE                           \
0840     . = ALIGN(8);                           \
0841     __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {     \
0842         __start___bug_table = .;                \
0843         KEEP(*(__bug_table))                    \
0844         __stop___bug_table = .;                 \
0845     }
0846 #else
0847 #define BUG_TABLE
0848 #endif
0849 
0850 #ifdef CONFIG_UNWINDER_ORC
0851 #define ORC_UNWIND_TABLE                        \
0852     . = ALIGN(4);                           \
0853     .orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) {   \
0854         __start_orc_unwind_ip = .;              \
0855         KEEP(*(.orc_unwind_ip))                 \
0856         __stop_orc_unwind_ip = .;               \
0857     }                               \
0858     . = ALIGN(2);                           \
0859     .orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) {     \
0860         __start_orc_unwind = .;                 \
0861         KEEP(*(.orc_unwind))                    \
0862         __stop_orc_unwind = .;                  \
0863     }                               \
0864     text_size = _etext - _stext;                    \
0865     . = ALIGN(4);                           \
0866     .orc_lookup : AT(ADDR(.orc_lookup) - LOAD_OFFSET) {     \
0867         orc_lookup = .;                     \
0868         . += (((text_size + LOOKUP_BLOCK_SIZE - 1) /        \
0869             LOOKUP_BLOCK_SIZE) + 1) * 4;            \
0870         orc_lookup_end = .;                 \
0871     }
0872 #else
0873 #define ORC_UNWIND_TABLE
0874 #endif
0875 
0876 /* Built-in firmware blobs */
0877 #ifdef CONFIG_FW_LOADER
0878 #define FW_LOADER_BUILT_IN_DATA                     \
0879     .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) {    \
0880         __start_builtin_fw = .;                 \
0881         KEEP(*(.builtin_fw))                    \
0882         __end_builtin_fw = .;                   \
0883     }
0884 #else
0885 #define FW_LOADER_BUILT_IN_DATA
0886 #endif
0887 
0888 #ifdef CONFIG_PM_TRACE
0889 #define TRACEDATA                           \
0890     . = ALIGN(4);                           \
0891     .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {       \
0892         __tracedata_start = .;                  \
0893         KEEP(*(.tracedata))                 \
0894         __tracedata_end = .;                    \
0895     }
0896 #else
0897 #define TRACEDATA
0898 #endif
0899 
0900 #ifdef CONFIG_PRINTK_INDEX
0901 #define PRINTK_INDEX                            \
0902     .printk_index : AT(ADDR(.printk_index) - LOAD_OFFSET) {     \
0903         __start_printk_index = .;               \
0904         *(.printk_index)                    \
0905         __stop_printk_index = .;                \
0906     }
0907 #else
0908 #define PRINTK_INDEX
0909 #endif
0910 
0911 #define NOTES                               \
0912     .notes : AT(ADDR(.notes) - LOAD_OFFSET) {           \
0913         __start_notes = .;                  \
0914         KEEP(*(.note.*))                    \
0915         __stop_notes = .;                   \
0916     } NOTES_HEADERS                         \
0917     NOTES_HEADERS_RESTORE
0918 
0919 #define INIT_SETUP(initsetup_align)                 \
0920         . = ALIGN(initsetup_align);             \
0921         __setup_start = .;                  \
0922         KEEP(*(.init.setup))                    \
0923         __setup_end = .;
0924 
0925 #define INIT_CALLS_LEVEL(level)                     \
0926         __initcall##level##_start = .;              \
0927         KEEP(*(.initcall##level##.init))            \
0928         KEEP(*(.initcall##level##s.init))           \
0929 
0930 #define INIT_CALLS                          \
0931         __initcall_start = .;                   \
0932         KEEP(*(.initcallearly.init))                \
0933         INIT_CALLS_LEVEL(0)                 \
0934         INIT_CALLS_LEVEL(1)                 \
0935         INIT_CALLS_LEVEL(2)                 \
0936         INIT_CALLS_LEVEL(3)                 \
0937         INIT_CALLS_LEVEL(4)                 \
0938         INIT_CALLS_LEVEL(5)                 \
0939         INIT_CALLS_LEVEL(rootfs)                \
0940         INIT_CALLS_LEVEL(6)                 \
0941         INIT_CALLS_LEVEL(7)                 \
0942         __initcall_end = .;
0943 
0944 #define CON_INITCALL                            \
0945         __con_initcall_start = .;               \
0946         KEEP(*(.con_initcall.init))             \
0947         __con_initcall_end = .;
0948 
0949 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */
0950 #define KUNIT_TABLE()                           \
0951         . = ALIGN(8);                       \
0952         __kunit_suites_start = .;               \
0953         KEEP(*(.kunit_test_suites))             \
0954         __kunit_suites_end = .;
0955 
0956 #ifdef CONFIG_BLK_DEV_INITRD
0957 #define INIT_RAM_FS                         \
0958     . = ALIGN(4);                           \
0959     __initramfs_start = .;                      \
0960     KEEP(*(.init.ramfs))                        \
0961     . = ALIGN(8);                           \
0962     KEEP(*(.init.ramfs.info))
0963 #else
0964 #define INIT_RAM_FS
0965 #endif
0966 
0967 /*
0968  * Memory encryption operates on a page basis. Since we need to clear
0969  * the memory encryption mask for this section, it needs to be aligned
0970  * on a page boundary and be a page-size multiple in length.
0971  *
0972  * Note: We use a separate section so that only this section gets
0973  * decrypted to avoid exposing more than we wish.
0974  */
0975 #ifdef CONFIG_AMD_MEM_ENCRYPT
0976 #define PERCPU_DECRYPTED_SECTION                    \
0977     . = ALIGN(PAGE_SIZE);                       \
0978     *(.data..decrypted)                     \
0979     *(.data..percpu..decrypted)                 \
0980     . = ALIGN(PAGE_SIZE);
0981 #else
0982 #define PERCPU_DECRYPTED_SECTION
0983 #endif
0984 
0985 
0986 /*
0987  * Default discarded sections.
0988  *
0989  * Some archs want to discard exit text/data at runtime rather than
0990  * link time due to cross-section references such as alt instructions,
0991  * bug table, eh_frame, etc.  DISCARDS must be the last of output
0992  * section definitions so that such archs put those in earlier section
0993  * definitions.
0994  */
0995 #ifdef RUNTIME_DISCARD_EXIT
0996 #define EXIT_DISCARDS
0997 #else
0998 #define EXIT_DISCARDS                           \
0999     EXIT_TEXT                           \
1000     EXIT_DATA
1001 #endif
1002 
1003 /*
1004  * Clang's -fprofile-arcs, -fsanitize=kernel-address, and
1005  * -fsanitize=thread produce unwanted sections (.eh_frame
1006  * and .init_array.*), but CONFIG_CONSTRUCTORS wants to
1007  * keep any .init_array.* sections.
1008  * https://bugs.llvm.org/show_bug.cgi?id=46478
1009  */
1010 #if defined(CONFIG_GCOV_KERNEL) || defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KCSAN) || \
1011     defined(CONFIG_CFI_CLANG)
1012 # ifdef CONFIG_CONSTRUCTORS
1013 #  define SANITIZER_DISCARDS                        \
1014     *(.eh_frame)
1015 # else
1016 #  define SANITIZER_DISCARDS                        \
1017     *(.init_array) *(.init_array.*)                 \
1018     *(.eh_frame)
1019 # endif
1020 #else
1021 # define SANITIZER_DISCARDS
1022 #endif
1023 
1024 #define COMMON_DISCARDS                         \
1025     SANITIZER_DISCARDS                      \
1026     *(.discard)                         \
1027     *(.discard.*)                           \
1028     *(.modinfo)                         \
1029     /* ld.bfd warns about .gnu.version* even when not emitted */    \
1030     *(.gnu.version*)                        \
1031 
1032 #define DISCARDS                            \
1033     /DISCARD/ : {                           \
1034     EXIT_DISCARDS                           \
1035     EXIT_CALL                           \
1036     COMMON_DISCARDS                         \
1037     }
1038 
1039 /**
1040  * PERCPU_INPUT - the percpu input sections
1041  * @cacheline: cacheline size
1042  *
1043  * The core percpu section names and core symbols which do not rely
1044  * directly upon load addresses.
1045  *
1046  * @cacheline is used to align subsections to avoid false cacheline
1047  * sharing between subsections for different purposes.
1048  */
1049 #define PERCPU_INPUT(cacheline)                     \
1050     __per_cpu_start = .;                        \
1051     *(.data..percpu..first)                     \
1052     . = ALIGN(PAGE_SIZE);                       \
1053     *(.data..percpu..page_aligned)                  \
1054     . = ALIGN(cacheline);                       \
1055     *(.data..percpu..read_mostly)                   \
1056     . = ALIGN(cacheline);                       \
1057     *(.data..percpu)                        \
1058     *(.data..percpu..shared_aligned)                \
1059     PERCPU_DECRYPTED_SECTION                    \
1060     __per_cpu_end = .;
1061 
1062 /**
1063  * PERCPU_VADDR - define output section for percpu area
1064  * @cacheline: cacheline size
1065  * @vaddr: explicit base address (optional)
1066  * @phdr: destination PHDR (optional)
1067  *
1068  * Macro which expands to output section for percpu area.
1069  *
1070  * @cacheline is used to align subsections to avoid false cacheline
1071  * sharing between subsections for different purposes.
1072  *
1073  * If @vaddr is not blank, it specifies explicit base address and all
1074  * percpu symbols will be offset from the given address.  If blank,
1075  * @vaddr always equals @laddr + LOAD_OFFSET.
1076  *
1077  * @phdr defines the output PHDR to use if not blank.  Be warned that
1078  * output PHDR is sticky.  If @phdr is specified, the next output
1079  * section in the linker script will go there too.  @phdr should have
1080  * a leading colon.
1081  *
1082  * Note that this macros defines __per_cpu_load as an absolute symbol.
1083  * If there is no need to put the percpu section at a predetermined
1084  * address, use PERCPU_SECTION.
1085  */
1086 #define PERCPU_VADDR(cacheline, vaddr, phdr)                \
1087     __per_cpu_load = .;                     \
1088     .data..percpu vaddr : AT(__per_cpu_load - LOAD_OFFSET) {    \
1089         PERCPU_INPUT(cacheline)                 \
1090     } phdr                              \
1091     . = __per_cpu_load + SIZEOF(.data..percpu);
1092 
1093 /**
1094  * PERCPU_SECTION - define output section for percpu area, simple version
1095  * @cacheline: cacheline size
1096  *
1097  * Align to PAGE_SIZE and outputs output section for percpu area.  This
1098  * macro doesn't manipulate @vaddr or @phdr and __per_cpu_load and
1099  * __per_cpu_start will be identical.
1100  *
1101  * This macro is equivalent to ALIGN(PAGE_SIZE); PERCPU_VADDR(@cacheline,,)
1102  * except that __per_cpu_load is defined as a relative symbol against
1103  * .data..percpu which is required for relocatable x86_32 configuration.
1104  */
1105 #define PERCPU_SECTION(cacheline)                   \
1106     . = ALIGN(PAGE_SIZE);                       \
1107     .data..percpu   : AT(ADDR(.data..percpu) - LOAD_OFFSET) {   \
1108         __per_cpu_load = .;                 \
1109         PERCPU_INPUT(cacheline)                 \
1110     }
1111 
1112 
1113 /*
1114  * Definition of the high level *_SECTION macros
1115  * They will fit only a subset of the architectures
1116  */
1117 
1118 
1119 /*
1120  * Writeable data.
1121  * All sections are combined in a single .data section.
1122  * The sections following CONSTRUCTORS are arranged so their
1123  * typical alignment matches.
1124  * A cacheline is typical/always less than a PAGE_SIZE so
1125  * the sections that has this restriction (or similar)
1126  * is located before the ones requiring PAGE_SIZE alignment.
1127  * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which
1128  * matches the requirement of PAGE_ALIGNED_DATA.
1129  *
1130  * use 0 as page_align if page_aligned data is not used */
1131 #define RW_DATA(cacheline, pagealigned, inittask)           \
1132     . = ALIGN(PAGE_SIZE);                       \
1133     .data : AT(ADDR(.data) - LOAD_OFFSET) {             \
1134         INIT_TASK_DATA(inittask)                \
1135         NOSAVE_DATA                     \
1136         PAGE_ALIGNED_DATA(pagealigned)              \
1137         CACHELINE_ALIGNED_DATA(cacheline)           \
1138         READ_MOSTLY_DATA(cacheline)             \
1139         DATA_DATA                       \
1140         CONSTRUCTORS                        \
1141     }                               \
1142     BUG_TABLE                           \
1143 
1144 #define INIT_TEXT_SECTION(inittext_align)               \
1145     . = ALIGN(inittext_align);                  \
1146     .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {       \
1147         _sinittext = .;                     \
1148         INIT_TEXT                       \
1149         _einittext = .;                     \
1150     }
1151 
1152 #define INIT_DATA_SECTION(initsetup_align)              \
1153     .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {       \
1154         INIT_DATA                       \
1155         INIT_SETUP(initsetup_align)             \
1156         INIT_CALLS                      \
1157         CON_INITCALL                        \
1158         INIT_RAM_FS                     \
1159     }
1160 
1161 #define BSS_SECTION(sbss_align, bss_align, stop_align)          \
1162     . = ALIGN(sbss_align);                      \
1163     __bss_start = .;                        \
1164     SBSS(sbss_align)                        \
1165     BSS(bss_align)                          \
1166     . = ALIGN(stop_align);                      \
1167     __bss_stop = .;