Skip to content

Commit cfc5845

Browse files
committed
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 c7d3dd9 ("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 8d18ef0 ("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 <[email protected]>
2 parents 38492c5 + 9338d66 commit cfc5845

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

arch/s390/kernel/vmlinux.lds.S

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,28 @@ SECTIONS
214214
DWARF_DEBUG
215215
ELF_DETAILS
216216

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+
217239
/*
218240
* uncompressed image info used by the decompressor
219241
* it should match struct vmlinux_info
@@ -244,28 +266,6 @@ SECTIONS
244266
#endif
245267
} :NONE
246268

247-
/*
248-
* Make sure that the .got.plt is either completely empty or it
249-
* contains only the three reserved double words.
250-
*/
251-
.got.plt : {
252-
*(.got.plt)
253-
}
254-
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")
255-
256-
/*
257-
* Sections that should stay zero sized, which is safer to
258-
* explicitly check instead of blindly discarding.
259-
*/
260-
.plt : {
261-
*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
262-
}
263-
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
264-
.rela.dyn : {
265-
*(.rela.*) *(.rela_*)
266-
}
267-
ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
268-
269269
/* Sections to be discarded */
270270
DISCARDS
271271
/DISCARD/ : {

scripts/Makefile.vmlinux

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ endif
8282
# ---------------------------------------------------------------------------
8383

8484
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.*'
8689

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

0 commit comments

Comments
 (0)