Skip to content

Commit 1429cfd

Browse files
ardbiesheuvelchenhuacai
authored andcommitted
LoongArch: Avoid orphan input sections
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>
1 parent b90cb10 commit 1429cfd

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

arch/loongarch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ config LOONGARCH
5151
select ARCH_USE_CMPXCHG_LOCKREF
5252
select ARCH_USE_QUEUED_RWLOCKS
5353
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
54+
select ARCH_WANT_LD_ORPHAN_WARN
5455
select ARCH_WANTS_NO_INSTR
5556
select BUILDTIME_TABLE_SORT
5657
select COMMON_CLK

arch/loongarch/kernel/vmlinux.lds.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ SECTIONS
7777
PERCPU_SECTION(1 << CONFIG_L1_CACHE_SHIFT)
7878
#endif
7979

80+
.rela.dyn : ALIGN(8) { *(.rela.dyn) *(.rela*) }
81+
8082
.init.bss : {
8183
*(.init.bss)
8284
}

0 commit comments

Comments
 (0)