b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #include <asm/page.h> |
| 3 | |
| 4 | /* |
| 5 | * With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and |
| 6 | * -ffunction-sections, which increases the size of the final module. |
| 7 | * Merge the split sections in the final binary. |
| 8 | */ |
| 9 | SECTIONS { |
| 10 | /* |
| 11 | * LLVM may emit .eh_frame with CONFIG_CFI_CLANG despite |
| 12 | * -fno-asynchronous-unwind-tables. Discard the section. |
| 13 | */ |
| 14 | /DISCARD/ : { |
| 15 | *(.eh_frame) |
| 16 | } |
| 17 | |
| 18 | .bss : { |
| 19 | *(.bss .bss.[0-9a-zA-Z_]*) |
| 20 | *(.bss..L*) |
| 21 | } |
| 22 | |
| 23 | .data : { |
| 24 | *(.data .data.[0-9a-zA-Z_]*) |
| 25 | *(.data..L*) |
| 26 | } |
| 27 | |
| 28 | .rodata : { |
| 29 | *(.rodata .rodata.[0-9a-zA-Z_]*) |
| 30 | *(.rodata..L*) |
| 31 | } |
| 32 | |
| 33 | /* |
| 34 | * With CFI_CLANG, ensure __cfi_check is at the beginning of the |
| 35 | * .text section, and that the section is aligned to page size. |
| 36 | */ |
| 37 | .text : ALIGN(PAGE_SIZE) { |
| 38 | *(.text.__cfi_check) |
| 39 | *(.text .text.[0-9a-zA-Z_]* .text..L.cfi*) |
| 40 | } |
| 41 | } |