Merge tag 'mips_5.12_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
[platform/kernel/linux-rpi.git] / include / asm-generic / vmlinux.lds.h
index ecfb54e..6786f8c 100644 (file)
  * .data. We don't want to pull in .data..other sections, which Linux
  * has defined. Same for text and bss.
  *
+ * With LTO_CLANG, the linker also splits sections by default, so we need
+ * these macros to combine the sections during the final link.
+ *
  * RODATA_MAIN is not used because existing code already defines .rodata.x
  * sections to be brought in with rodata.
  */
-#ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
+#if defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || defined(CONFIG_LTO_CLANG)
 #define TEXT_MAIN .text .text.[0-9a-zA-Z_]*
 #define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* .data.$__unnamed_* .data.$L*
 #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]*
 #define THERMAL_TABLE(name)
 #endif
 
+#ifdef CONFIG_DTPM
+#define DTPM_TABLE()                                                   \
+       . = ALIGN(8);                                                   \
+       __dtpm_table = .;                                               \
+       KEEP(*(__dtpm_table))                                           \
+       __dtpm_table_end = .;
+#else
+#define DTPM_TABLE()
+#endif
+
 #define KERNEL_DTB()                                                   \
        STRUCT_ALIGN();                                                 \
        __dtb_start = .;                                                \
        . = ALIGN(8);                                                   \
        __start_static_call_sites = .;                                  \
        KEEP(*(.static_call_sites))                                     \
-       __stop_static_call_sites = .;
+       __stop_static_call_sites = .;                                   \
+       __start_static_call_tramp_key = .;                              \
+       KEEP(*(.static_call_tramp_key))                                 \
+       __stop_static_call_tramp_key = .;
 
 /*
  * Allow architectures to handle ro_after_init data on their
        }                                                               \
                                                                        \
        /* Built-in firmware blobs */                                   \
-       .builtin_fw        : AT(ADDR(.builtin_fw) - LOAD_OFFSET) {      \
+       .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) {    \
                __start_builtin_fw = .;                                 \
                KEEP(*(.builtin_fw))                                    \
                __end_builtin_fw = .;                                   \
                __stop___ksymtab_gpl = .;                               \
        }                                                               \
                                                                        \
-       /* Kernel symbol table: Normal unused symbols */                \
-       __ksymtab_unused  : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) {  \
-               __start___ksymtab_unused = .;                           \
-               KEEP(*(SORT(___ksymtab_unused+*)))                      \
-               __stop___ksymtab_unused = .;                            \
-       }                                                               \
-                                                                       \
-       /* Kernel symbol table: GPL-only unused symbols */              \
-       __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
-               __start___ksymtab_unused_gpl = .;                       \
-               KEEP(*(SORT(___ksymtab_unused_gpl+*)))                  \
-               __stop___ksymtab_unused_gpl = .;                        \
-       }                                                               \
-                                                                       \
-       /* Kernel symbol table: GPL-future-only symbols */              \
-       __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
-               __start___ksymtab_gpl_future = .;                       \
-               KEEP(*(SORT(___ksymtab_gpl_future+*)))                  \
-               __stop___ksymtab_gpl_future = .;                        \
-       }                                                               \
-                                                                       \
        /* Kernel symbol table: Normal symbols */                       \
        __kcrctab         : AT(ADDR(__kcrctab) - LOAD_OFFSET) {         \
                __start___kcrctab = .;                                  \
                __stop___kcrctab_gpl = .;                               \
        }                                                               \
                                                                        \
-       /* Kernel symbol table: Normal unused symbols */                \
-       __kcrctab_unused  : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) {  \
-               __start___kcrctab_unused = .;                           \
-               KEEP(*(SORT(___kcrctab_unused+*)))                      \
-               __stop___kcrctab_unused = .;                            \
-       }                                                               \
-                                                                       \
-       /* Kernel symbol table: GPL-only unused symbols */              \
-       __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
-               __start___kcrctab_unused_gpl = .;                       \
-               KEEP(*(SORT(___kcrctab_unused_gpl+*)))                  \
-               __stop___kcrctab_unused_gpl = .;                        \
-       }                                                               \
-                                                                       \
-       /* Kernel symbol table: GPL-future-only symbols */              \
-       __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
-               __start___kcrctab_gpl_future = .;                       \
-               KEEP(*(SORT(___kcrctab_gpl_future+*)))                  \
-               __stop___kcrctab_gpl_future = .;                        \
-       }                                                               \
-                                                                       \
        /* Kernel symbol table: strings */                              \
         __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {        \
                *(__ksymtab_strings)                                    \
        ACPI_PROBE_TABLE(irqchip)                                       \
        ACPI_PROBE_TABLE(timer)                                         \
        THERMAL_TABLE(governor)                                         \
+       DTPM_TABLE()                                                    \
        EARLYCON_TABLE()                                                \
        LSM_TABLE()                                                     \
        EARLY_LSM_TABLE()                                               \
                /* DWARF 4 */                                           \
                .debug_types    0 : { *(.debug_types) }                 \
                /* DWARF 5 */                                           \
+               .debug_addr     0 : { *(.debug_addr) }                  \
+               .debug_line_str 0 : { *(.debug_line_str) }              \
+               .debug_loclists 0 : { *(.debug_loclists) }              \
                .debug_macro    0 : { *(.debug_macro) }                 \
-               .debug_addr     0 : { *(.debug_addr) }
+               .debug_names    0 : { *(.debug_names) }                 \
+               .debug_rnglists 0 : { *(.debug_rnglists) }              \
+               .debug_str_offsets      0 : { *(.debug_str_offsets) }
 
 /* Stabs debugging sections. */
 #define STABS_DEBUG                                                    \