]> git.baikalelectronics.ru Git - kernel.git/commitdiff
LoongArch: Avoid orphan input sections
authorArd Biesheuvel <ardb@kernel.org>
Wed, 24 Aug 2022 15:31:10 +0000 (17:31 +0200)
committerHuacai Chen <chenhuacai@loongson.cn>
Sat, 3 Sep 2022 10:01:27 +0000 (18:01 +0800)
Ensure that all input sections are listed explicitly in the linker
script, and issue a warning otherwise. This ensures that the binary
image matches the PE/COFF and other image metadata exactly, which is
important for things like code signing.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig
arch/loongarch/kernel/vmlinux.lds.S

index 26aeb1408e56937ac20491937b05d58507ff5719..3bc5b911ae1aa003b3aae63aba2beba2bfa148bd 100644 (file)
@@ -51,6 +51,7 @@ config LOONGARCH
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_USE_QUEUED_RWLOCKS
        select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
+       select ARCH_WANT_LD_ORPHAN_WARN
        select ARCH_WANTS_NO_INSTR
        select BUILDTIME_TABLE_SORT
        select COMMON_CLK
index 69c76f26c1c57e03ba4ff6389111abd8cbedf03a..f4831df5d2f9a5d4001ee0ab1e8ef545bb036b87 100644 (file)
@@ -77,6 +77,8 @@ SECTIONS
        PERCPU_SECTION(1 << CONFIG_L1_CACHE_SHIFT)
 #endif
 
+       .rela.dyn : ALIGN(8) { *(.rela.dyn) *(.rela*) }
+
        .init.bss : {
                *(.init.bss)
        }