s390/kernel: emit CFI data in .debug_frame and discard .eh_frame sections
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Mon, 20 Nov 2017 10:41:07 +0000 (11:41 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 13 Dec 2017 09:51:35 +0000 (10:51 +0100)
commitbc3703f21cec8a2ac6a64f6fb3686fbcb1ba1513
tree8afb21635860b1ba73e8d5be04536b626cbb338b
parenta5f1005517534aeb1fac20180badfbf0896c183c
s390/kernel: emit CFI data in .debug_frame and discard .eh_frame sections

Using perf probe and libdw on kernel modules failed to find CFI
data for symbols.  The CFI data is stored in the .eh_frame section.
The elfutils libdw is not able to extract the CFI data correctly,
because the .eh_frame section requires "non-simple" relocations
for kernel modules.

The suggestion is to avoid these "non-simple" relocations by emitting
the CFI data in the .debug_frame section.  Let gcc emit respective
directives by specifying the -fno-asynchronous-unwind-tables option.

Using the .debug_frame section for CFI data, the .eh_frame section
becomes unused and, thus, discard it for kernel and modules builds

The vDSO requires the .eh_frame section and, hence, emit the CFI data
in both, the .eh_frame and .debug_frame sections.

See also discussion on elfutils/libdw bugzilla:
https://sourceware.org/bugzilla/show_bug.cgi?id=22452

Suggested-by: Mark Wielaard <mark@klomp.org>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
13 files changed:
arch/s390/Makefile
arch/s390/include/asm/dwarf.h [new file with mode: 0644]
arch/s390/kernel/vdso32/Makefile
arch/s390/kernel/vdso32/clock_getres.S
arch/s390/kernel/vdso32/clock_gettime.S
arch/s390/kernel/vdso32/getcpu.S
arch/s390/kernel/vdso32/gettimeofday.S
arch/s390/kernel/vdso64/Makefile
arch/s390/kernel/vdso64/clock_getres.S
arch/s390/kernel/vdso64/clock_gettime.S
arch/s390/kernel/vdso64/getcpu.S
arch/s390/kernel/vdso64/gettimeofday.S
arch/s390/kernel/vmlinux.lds.S