s390: vmlinux.lds.S: fix .got.plt assertion
authorHeiko Carstens <hca@linux.ibm.com>
Sun, 25 Feb 2024 16:39:12 +0000 (17:39 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Sun, 25 Feb 2024 17:01:09 +0000 (18:01 +0100)
commita795e5d2347def129734a7f247ac70339d50d8c2
tree9a84b5434cd6a9225922166d1b3d662f4e77d7e7
parent7f115ff4fc20698452ff4a1cbb9c790be10b0066
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
arch/s390/kernel/vmlinux.lds.S