Skip to content

Commit 9338d66

Browse files
committed
s390/vmlinux.lds.S: Move .vmlinux.info to end of allocatable sections
When building s390 defconfig with binutils older than 2.32, there are several warnings during the final linking stage: s390-linux-ld: .tmp_vmlinux1: warning: allocated section `.got.plt' not in segment s390-linux-ld: .tmp_vmlinux2: warning: allocated section `.got.plt' not in segment s390-linux-ld: vmlinux.unstripped: warning: allocated section `.got.plt' not in segment s390-linux-objcopy: vmlinux: warning: allocated section `.got.plt' not in segment s390-linux-objcopy: st7afZyb: warning: allocated section `.got.plt' not in segment binutils commit afca762f598 ("S/390: Improve partial relro support for 64 bit") [1] in 2.32 changed where .got.plt is emitted, avoiding the warning. The :NONE in the .vmlinux.info output section description changes the segment for subsequent allocated sections. Move .vmlinux.info right above the discards section to place all other sections in the previously defined segment, .data. Fixes: 3022685 ("s390: vmlinux.lds.S: explicitly handle '.got' and '.plt' sections") Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=afca762f598d453c563f244cd3777715b1a0cb72 [1] Acked-by: Alexander Gordeev <[email protected]> Acked-by: Alexey Gladkov <[email protected]> Acked-by: Nicolas Schier <[email protected]> Link: https://patch.msgid.link/20251008-kbuild-fix-modinfo-regressions-v1-3-9fc776c5887c@kernel.org Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 8ec3af9 commit 9338d66

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
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/ : {

0 commit comments

Comments
 (0)