From: Heiko Carstens <hca@linux.ibm.com>
To: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: open list <linux-kernel@vger.kernel.org>,
linux-s390@vger.kernel.org, lkft-triage@lists.linaro.org,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Arnd Bergmann <arnd@arndb.de>,
Sven Schnelle <svens@linux.ibm.com>,
Andreas Krebbel <krebbel@linux.ibm.com>,
Nathan Chancellor <nathan@kernel.org>
Subject: Re: s390: s390x-linux-gnu-ld: Unexpected GOT/PLT entries detected!
Date: Sun, 25 Feb 2024 18:51:56 +0100 [thread overview]
Message-ID: <20240225175156.11025-A-hca@linux.ibm.com> (raw)
In-Reply-To: <CA+G9fYvWp8TY-fMEvc3UhoVtoR_eM5VsfHj3+n+kexcfJJ+Cvw@mail.gmail.com>
On Fri, Feb 23, 2024 at 03:11:50PM +0530, Naresh Kamboju wrote:
> [ Please ignore this email if it is already reported ]
>
> The s390 gcc-8 builds failed on Linux next tag next-20240215..next-20240223.
> First build failures noticed on tag next-20240215 for both gcc-13 and gcc-8.
> But from the next tag next-20240216 gcc-13 passed but gcc-8 failed.
>
> s390:
> - defconfig-fe40093d - gcc-8 - Failed
> - tinyconfig - gcc-8 - Failed
> - allnoconfig - gcc-8 - Failed
...
> Build log:
> ---------
> s390x-linux-gnu-ld: Unexpected GOT/PLT entries detected!
> make[3]: *** [/builds/linux/arch/s390/boot/Makefile:87:
> arch/s390/boot/vmlinux.syms] Error 1
> make[3]: Target 'arch/s390/boot/bzImage' not remade because of errors.
...
> Steps to reproduce:
> $ tuxmake --runtime podman --target-arch s390 --toolchain gcc-8
> --kconfig tinyconfig
>
> Links:
> - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20240223/testrun/22812529/suite/build/test/gcc-8-defconfig-fe40093d/details/
> - https://storage.tuxsuite.com/public/linaro/lkft/builds/2cl8pys1B3Vc4oOB2yXcaYkfnKw/
Thanks should hopefully be fixed with the patch below, which should be
part of the next linux-next release.
https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git/commit/?h=features&id=a795e5d2347def129734a7f247ac70339d50d8c2
From a795e5d2347def129734a7f247ac70339d50d8c2 Mon Sep 17 00:00:00 2001
From: Heiko Carstens <hca@linux.ibm.com>
Date: Sun, 25 Feb 2024 17:39:12 +0100
Subject: [PATCH] s390: vmlinux.lds.S: fix .got.plt assertion
Naresh reported this build error on linux-next:
s390x-linux-gnu-ld: Unexpected GOT/PLT entries detected!
make[3]: *** [/builds/linux/arch/s390/boot/Makefile:87:
arch/s390/boot/vmlinux.syms] Error 1
make[3]: Target 'arch/s390/boot/bzImage' not remade because of errors.
The reason for the build error is an incorrect/incomplete assertion which
checks the size of the .got.plt section. Similar to x86 the size is either
zero or 24 bytes (three entries).
See commit 262b5cae67a6 ("x86/boot/compressed: Move .got.plt entries out of
the .got section") for more details. The three reserved/additional entries
for s390 are described in chapter 3.2.2 of the s390x ABI [1] (thanks to
Andreas Krebbel for pointing this out!).
[1] https://github.com/IBM/s390x-abi/releases/download/v1.6.1/lzsabi_s390x.pdf
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/all/CA+G9fYvWp8TY-fMEvc3UhoVtoR_eM5VsfHj3+n+kexcfJJ+Cvw@mail.gmail.com
Fixes: 30226853d6ec ("s390: vmlinux.lds.S: explicitly handle '.got' and '.plt' sections")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/boot/vmlinux.lds.S | 11 ++++++++---
arch/s390/kernel/vmlinux.lds.S | 11 ++++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/arch/s390/boot/vmlinux.lds.S b/arch/s390/boot/vmlinux.lds.S
index e3208893ba6b..3d7ea585ab99 100644
--- a/arch/s390/boot/vmlinux.lds.S
+++ b/arch/s390/boot/vmlinux.lds.S
@@ -144,13 +144,18 @@ SECTIONS
ELF_DETAILS
/*
- * Sections that should stay zero sized, which is safer to
- * explicitly check instead of blindly discarding.
+ * 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, "Unexpected GOT/PLT entries detected!")
+ 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)
}
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 404883b1b023..9c59715d1745 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -266,13 +266,18 @@ SECTIONS
ELF_DETAILS
/*
- * Sections that should stay zero sized, which is safer to
- * explicitly check instead of blindly discarding.
+ * 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, "Unexpected GOT/PLT entries detected!")
+ 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)
}
--
2.43.2
prev parent reply other threads:[~2024-02-25 17:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 9:41 s390: s390x-linux-gnu-ld: Unexpected GOT/PLT entries detected! Naresh Kamboju
2024-02-25 17:51 ` Heiko Carstens [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240225175156.11025-A-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=krebbel@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=lkft-triage@lists.linaro.org \
--cc=naresh.kamboju@linaro.org \
--cc=nathan@kernel.org \
--cc=svens@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox