^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Common module linker script, always used when linking a module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Archs are free to supply their own linker scripts. ld will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * combine them automatically.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) SECTIONS {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) /DISCARD/ : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *(.discard)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *(.discard.*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * LLD may emit .eh_frame with CONFIG_CFI_CLANG despite
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * -fno-asynchronous-unwind-tables. Discard the section.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) *(.eh_frame)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) __ksymtab 0 : { *(SORT(___ksymtab+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) __ksymtab_gpl 0 : { *(SORT(___ksymtab_gpl+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) __ksymtab_unused 0 : { *(SORT(___ksymtab_unused+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __ksymtab_unused_gpl 0 : { *(SORT(___ksymtab_unused_gpl+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) __ksymtab_gpl_future 0 : { *(SORT(___ksymtab_gpl_future+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) __kcrctab 0 : { *(SORT(___kcrctab+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) __kcrctab_gpl 0 : { *(SORT(___kcrctab_gpl+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) __kcrctab_unused 0 : { *(SORT(___kcrctab_unused+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __kcrctab_unused_gpl 0 : { *(SORT(___kcrctab_unused_gpl+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __kcrctab_gpl_future 0 : { *(SORT(___kcrctab_gpl_future+*)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __patchable_function_entries : { *(__patchable_function_entries) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #ifdef CONFIG_LTO_CLANG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * -ffunction-sections, which increases the size of the final module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * Merge the split sections in the final binary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) .bss : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) *(.bss .bss.[0-9a-zA-Z_]*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) *(.bss..L*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) .data : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) *(.data .data.[0-9a-zA-Z_]*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) *(.data..L*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) .rodata : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) *(.rodata.._start)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) *(.rodata .rodata.[0-9a-zA-Z_]*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) *(.rodata..L*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) *(.rodata.._end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) .text : ALIGN(PAGE_SIZE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) *(.text.._start)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #ifdef CONFIG_CFI_CLANG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * With CFI_CLANG, ensure __cfi_check is at the beginning of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) * the .text section, and that the section is aligned to page
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) * size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) *(.text.__cfi_check)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) *(.text .text.[0-9a-zA-Z_]*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) __cfi_jt_start = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) *(.text..L.cfi.jumptable .text..L.cfi.jumptable.*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) __cfi_jt_end = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) *(.text.._end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) *(.text.._fips140_unchecked)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) /* bring in arch-specific sections */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #include <asm/module.lds.h>