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 c7d3dd9163e6
("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 8d18ef04f940
("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: Nathan Chancellor <nathan@kernel.org>

+26 -23
+22 -22
arch/s390/kernel/vmlinux.lds.S
··· 215 215 ELF_DETAILS 216 216 217 217 /* 218 + * Make sure that the .got.plt is either completely empty or it 219 + * contains only the three reserved double words. 220 + */ 221 + .got.plt : { 222 + *(.got.plt) 223 + } 224 + ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!") 225 + 226 + /* 227 + * Sections that should stay zero sized, which is safer to 228 + * explicitly check instead of blindly discarding. 229 + */ 230 + .plt : { 231 + *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt) 232 + } 233 + ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!") 234 + .rela.dyn : { 235 + *(.rela.*) *(.rela_*) 236 + } 237 + ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!") 238 + 239 + /* 218 240 * uncompressed image info used by the decompressor 219 241 * it should match struct vmlinux_info 220 242 */ ··· 265 243 QUAD(kasan_early_shadow_p4d) 266 244 #endif 267 245 } :NONE 268 - 269 - /* 270 - * Make sure that the .got.plt is either completely empty or it 271 - * contains only the three reserved double words. 272 - */ 273 - .got.plt : { 274 - *(.got.plt) 275 - } 276 - ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!") 277 - 278 - /* 279 - * Sections that should stay zero sized, which is safer to 280 - * explicitly check instead of blindly discarding. 281 - */ 282 - .plt : { 283 - *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt) 284 - } 285 - ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!") 286 - .rela.dyn : { 287 - *(.rela.*) *(.rela_*) 288 - } 289 - ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!") 290 246 291 247 /* Sections to be discarded */ 292 248 DISCARDS
+4 -1
scripts/Makefile.vmlinux
··· 82 82 # --------------------------------------------------------------------------- 83 83 84 84 remove-section-y := .modinfo 85 - remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*' 85 + remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*' '!.rel*.dyn' 86 + # for compatibility with binutils < 2.32 87 + # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c12d9fa2afe7abcbe407a00e15719e1a1350c2a7 88 + remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel.*' 86 89 87 90 remove-symbols := -w --strip-symbol='__mod_device_table__*' 88 91