Unverified Commit cfc58453 authored by Nathan Chancellor's avatar Nathan Chancellor
Browse files

Merge patch series "kbuild: Fixes for fallout from recent modules.builtin.modinfo series"

This is a series to address some problems that were exposed by the
recent modules.builtin.modinfo series that landed in commit c7d3dd91
("Merge patch series "Add generated modalias to
modules.builtin.modinfo"").

The third patch is not directly related to the aforementioned series, as
the warning it fixes happens prior to the series but commit 8d18ef04
("s390: vmlinux.lds.S: Reorder sections") from the series creates
conflicts in this area, so I included it here.

Link: https://patch.msgid.link/20251008-kbuild-fix-modinfo-regressions-v1-0-9fc776c5887c@kernel.org


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
parents 38492c57 9338d660
Loading
Loading
Loading
Loading
+22 −22
Original line number Diff line number Diff line
@@ -214,6 +214,28 @@ SECTIONS
	DWARF_DEBUG
	ELF_DETAILS

	/*
	 * Make sure that the .got.plt is either completely empty or it
	 * contains only the three reserved double words.
	 */
	.got.plt : {
		*(.got.plt)
	}
	ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")

	/*
	 * Sections that should stay zero sized, which is safer to
	 * explicitly check instead of blindly discarding.
	 */
	.plt : {
		*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
	}
	ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
	.rela.dyn : {
		*(.rela.*) *(.rela_*)
	}
	ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")

	/*
	 * uncompressed image info used by the decompressor
	 * it should match struct vmlinux_info
@@ -244,28 +266,6 @@ SECTIONS
#endif
	} :NONE

	/*
	 * Make sure that the .got.plt is either completely empty or it
	 * contains only the three reserved double words.
	 */
	.got.plt : {
		*(.got.plt)
	}
	ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")

	/*
	 * Sections that should stay zero sized, which is safer to
	 * explicitly check instead of blindly discarding.
	 */
	.plt : {
		*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
	}
	ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
	.rela.dyn : {
		*(.rela.*) *(.rela_*)
	}
	ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")

	/* Sections to be discarded */
	DISCARDS
	/DISCARD/ : {
+4 −1
Original line number Diff line number Diff line
@@ -82,7 +82,10 @@ endif
# ---------------------------------------------------------------------------

remove-section-y                                   := .modinfo
remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*'
remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*' '!.rel*.dyn'
# for compatibility with binutils < 2.32
# https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c12d9fa2afe7abcbe407a00e15719e1a1350c2a7
remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel.*'

remove-symbols := -w --strip-symbol='__mod_device_table__*'