Skip to content

Commit 83109d5

Browse files
keesIngo Molnar
authored andcommitted
x86/build: Warn on orphan section placement
We don't want to depend on the linker's orphan section placement heuristics as these can vary between linkers, and may change between versions. All sections need to be explicitly handled in the linker script. Now that all sections are explicitly handled, enable orphan section warnings. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4409d2f commit 83109d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ ifdef CONFIG_X86_64
209209
LDFLAGS_vmlinux += -z max-page-size=0x200000
210210
endif
211211

212+
# We never want expected sections to be placed heuristically by the
213+
# linker. All sections should be explicitly named in the linker script.
214+
LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
215+
212216
archscripts: scripts_basic
213217
$(Q)$(MAKE) $(build)=arch/x86/tools relocs
214218

0 commit comments

Comments
 (0)