mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
Merge "ANDROID: kbuild: ensure __cfi_check is correctly aligned"
This commit is contained in:
commit
a9e028c82c
3 changed files with 16 additions and 2 deletions
2
Makefile
2
Makefile
|
|
@ -890,7 +890,7 @@ LD_FLAGS_LTO_CLANG := -mllvm -import-instr-limit=5
|
|||
KBUILD_LDFLAGS += $(LD_FLAGS_LTO_CLANG)
|
||||
KBUILD_LDFLAGS_MODULE += $(LD_FLAGS_LTO_CLANG)
|
||||
|
||||
KBUILD_LDS_MODULE += $(srctree)/scripts/module-lto.lds
|
||||
KBUILD_LDS_MODULE += scripts/module-lto.lds
|
||||
endif
|
||||
|
||||
ifdef CONFIG_LTO
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ always := $(hostprogs-y) $(hostprogs-m)
|
|||
# The following hostprogs-y programs are only build on demand
|
||||
hostprogs-y += unifdef
|
||||
|
||||
extra-$(CONFIG_LTO_CLANG) += module-lto.lds
|
||||
|
||||
subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
|
||||
subdir-$(CONFIG_MODVERSIONS) += genksyms
|
||||
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#include <asm/page.h>
|
||||
|
||||
/*
|
||||
* With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and
|
||||
* -ffunction-sections, which increases the size of the final module.
|
||||
|
|
@ -18,5 +21,14 @@ SECTIONS {
|
|||
.rela.rodata : { *(.rela.rodata .rela.rodata.[0-9a-zA-Z_]*) }
|
||||
.rela.text : { *(.rela.text .rela.text.[0-9a-zA-Z_]*) }
|
||||
.rodata : { *(.rodata .rodata.[0-9a-zA-Z_]*) }
|
||||
.text : { *(.text .text.[0-9a-zA-Z_]*) }
|
||||
|
||||
/*
|
||||
* With CFI_CLANG, ensure __cfi_check is at the beginning of the
|
||||
* .text section, and that the section is aligned to page size.
|
||||
*/
|
||||
.text : ALIGN(PAGE_SIZE) {
|
||||
*(.text.__cfi_check)
|
||||
*(.text .text.[0-9a-zA-Z_]* .text..L.cfi*)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue