Skip to content

Commit d15e431

Browse files
sumanthkorikkarAlexander Gordeev
authored andcommitted
s390/vdso: filter out mno-pic-data-is-text-relative cflag
cmd_vdso_check checks if there are any dynamic relocations in vdso64.so.dbg. When kernel is compiled with -mno-pic-data-is-text-relative, R_390_RELATIVE relocs are generated and this results in kernel build error. kpatch uses -mno-pic-data-is-text-relative option when building the kernel to prevent relative addressing between code and data. The flag avoids relocation error when klp text and data are too far apart kpatch does not patch vdso code and hence the mno-pic-data-is-text-relative flag is not essential. Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent 27d4565 commit d15e431

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

arch/s390/kernel/vdso32/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS))
1919
KBUILD_AFLAGS_32 += -m31 -s
2020

2121
KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
22+
KBUILD_CFLAGS_32 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_32))
2223
KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin
2324

2425
LDFLAGS_vdso32.so.dbg += -fPIC -shared -soname=linux-vdso32.so.1 \

arch/s390/kernel/vdso64/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ KBUILD_AFLAGS_64 := $(filter-out -m64,$(KBUILD_AFLAGS))
2424
KBUILD_AFLAGS_64 += -m64
2525

2626
KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS))
27+
KBUILD_CFLAGS_64 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_64))
2728
KBUILD_CFLAGS_64 += -m64 -fPIC -fno-common -fno-builtin
2829
ldflags-y := -fPIC -shared -soname=linux-vdso64.so.1 \
2930
--hash-style=both --build-id=sha1 -T

0 commit comments

Comments
 (0)