s390: Compile kernel with -fPIC and link with -no-pie
authorSumanth Korikkar <sumanthk@linux.ibm.com>
Thu, 25 Apr 2024 14:59:31 +0000 (16:59 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Mon, 29 Apr 2024 15:33:30 +0000 (17:33 +0200)
commit00cda11d3b2ea07295490b7d67942014f1cbc5c1
treeeb27959101e584b9ff882be1b4d5f8b09b864cb2
parent5f90003f09042b504d90ee38618cfd380ce16f4a
s390: Compile kernel with -fPIC and link with -no-pie

When the kernel is built with CONFIG_PIE_BUILD option enabled it
uses dynamic symbols, for which the linker does not allow more
than 64K number of entries. This can break features like kpatch.

Hence, whenever possible the kernel is built with CONFIG_PIE_BUILD
option disabled. For that support of unaligned symbols generated by
linker scripts in the compiler is necessary.

However, older compilers might lack such support. In that case the
build process resorts to CONFIG_PIE_BUILD option-enabled build.

Compile object files with -fPIC option and then link the kernel
binary with -no-pie linker option.

As result, the dynamic symbols are not generated and not only kpatch
feature succeeds, but also the whole CONFIG_PIE_BUILD option-enabled
code could be dropped.

[ agordeev: Reworded the commit message ]

Suggested-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/Kconfig
arch/s390/Makefile
arch/s390/boot/Makefile
arch/s390/boot/boot.h
arch/s390/boot/startup.c
arch/s390/boot/vmlinux.lds.S
arch/s390/kernel/vmlinux.lds.S
This page took 0.060055 seconds and 4 git commands to generate.