From 10002f5aa671de2878252aaa48f585457d39638a Mon Sep 17 00:00:00 2001 From: Sumanth Korikkar Date: Tue, 29 Mar 2022 10:20:19 +0200 Subject: [PATCH] kpatch/s390: Add gcc prerequisite flags for kpatch 1. -mno-pic-data-is-text-relative prevents relative addressing between code and data. This is needed to avoid relocation error when klp text and data are too far apart 2. Avoid generation of LANCHOR symbols through -fno-section-anchors. kpatch-build does not handle it well. Signed-off-by: Sumanth Korikkar --- kpatch-build/kpatch-build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 9f0fc6d..7cdae87 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -937,6 +937,10 @@ if [[ "$ARCH" = "ppc64le" ]]; then ARCH_KCFLAGS="-mcmodel=large -fplugin=$PLUGINDIR/ppc64le-plugin.so" fi +if [[ "$ARCH" = "s390x" ]]; then + ARCH_KCFLAGS="-mno-pic-data-is-text-relative -fno-section-anchors" +fi + export KCFLAGS="-I$DATADIR/patch -ffunction-sections -fdata-sections \ $ARCH_KCFLAGS $DEBUG_KCFLAGS"