From 7bceec4e58ee23be653c0dd366479d6cb64ae686 Mon Sep 17 00:00:00 2001 From: Hendrik Brueckner Date: Mon, 20 Nov 2017 11:46:13 +0100 Subject: s390/vdso: revise CFI annotations of vDSO functions Revise and add CFI CFA and register rule annotations to the vDSO functions for proper stack unwinding and debugging. Because glibc might call the vDSO in special ways, the vDSO code does not rely on a stack frame created by the caller. The TOD clock value can be therefore not stored in the pre-allocated stack area and additional stack space is required. To correctly annotate these situations with CFI, the .cfi_val_offset directive is required to create relative offsets on the value of the stack register %r15. Because the .cfi_val_offset directive is available with recent GNU assembler versions only, additional checks are necessary. Note that if the vDSO is assembled with an older assembler version, stack unwinding and debugging from within the vDSO code might not be possible. Signed-off-by: Hendrik Brueckner Reviewed-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'arch/s390/Makefile') diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 494bb9ad5edf..aa37ba79c762 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -88,10 +88,13 @@ KBUILD_CFLAGS += -DCC_USING_HOTPATCH endif endif +# Test CFI features of binutils +cfi := $(call as-instr,.cfi_startproc\n.cfi_val_offset 15$(comma)-160\n.cfi_endproc,-DCONFIG_AS_CFI_VAL_OFFSET=1) + KBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y) KBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare -KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -KBUILD_AFLAGS += $(aflags-y) +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables $(cfi) +KBUILD_AFLAGS += $(aflags-y) $(cfi) OBJCOPYFLAGS := -O binary -- cgit v1.2.3