diff --git a/Makefile b/Makefile index 2e38697e511c..54103345823e 100644 --- a/Makefile +++ b/Makefile @@ -873,7 +873,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 += scripts/module-lto.lds +KBUILD_LDS_MODULE += $(srctree)/scripts/module-lto.lds endif ifdef CONFIG_LTO diff --git a/scripts/Makefile b/scripts/Makefile index 543603e3a789..3e86b300f5a1 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -31,8 +31,6 @@ 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 diff --git a/scripts/module-lto.lds.S b/scripts/module-lto.lds similarity index 86% rename from scripts/module-lto.lds.S rename to scripts/module-lto.lds index a89f0c57b36f..38cd6cf87ef1 100644 --- a/scripts/module-lto.lds.S +++ b/scripts/module-lto.lds @@ -1,6 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#include - /* * With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and * -ffunction-sections, which increases the size of the final module. @@ -32,9 +30,9 @@ SECTIONS { /* * With CFI_CLANG, ensure __cfi_check is at the beginning of the - * .text section, and that the section is aligned to page size. + * .text section, and that the section is aligned to 4k. */ - .text : ALIGN(PAGE_SIZE) { + .text : ALIGN(4096) { *(.text.__cfi_check) *(.text .text.[0-9a-zA-Z_]* .text..L.cfi*) }