android_kernel_xiaomi_sm8350/scripts/module-lto.lds
Sami Tolvanen f58c4d2771 ANDROID: kbuild: don't preprocess module-lto.lds
__cfi_check needs to be aligned to 4k, not necessarily PAGE_SIZE.
Furthermore, using arch-specific includes currently breaks `make
scripts`.

Bug: 165591024
Change-Id: Id80fce84d4c111374718d8d84e7c06812a5d4e4b
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2020-08-19 09:15:50 -07:00

40 lines
816 B
Plaintext

/* SPDX-License-Identifier: GPL-2.0 */
/*
* With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and
* -ffunction-sections, which increases the size of the final module.
* Merge the split sections in the final binary.
*/
SECTIONS {
/*
* LLVM may emit .eh_frame with CONFIG_CFI_CLANG despite
* -fno-asynchronous-unwind-tables. Discard the section.
*/
/DISCARD/ : {
*(.eh_frame)
}
.bss : {
*(.bss .bss.[0-9a-zA-Z_]*)
*(.bss..L*)
}
.data : {
*(.data .data.[0-9a-zA-Z_]*)
*(.data..L*)
}
.rodata : {
*(.rodata .rodata.[0-9a-zA-Z_]*)
*(.rodata..L*)
}
/*
* With CFI_CLANG, ensure __cfi_check is at the beginning of the
* .text section, and that the section is aligned to 4k.
*/
.text : ALIGN(4096) {
*(.text.__cfi_check)
*(.text .text.[0-9a-zA-Z_]* .text..L.cfi*)
}
}