diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2017-11-20 11:41:07 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-12-13 10:51:35 +0100 |
commit | bc3703f21cec8a2ac6a64f6fb3686fbcb1ba1513 (patch) | |
tree | 8afb21635860b1ba73e8d5be04536b626cbb338b /arch/s390/include/asm/dwarf.h | |
parent | s390/pci: handle insufficient resources during dma tlb flush (diff) | |
download | linux-bc3703f21cec8a2ac6a64f6fb3686fbcb1ba1513.tar.xz linux-bc3703f21cec8a2ac6a64f6fb3686fbcb1ba1513.zip |
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>
Diffstat (limited to 'arch/s390/include/asm/dwarf.h')
-rw-r--r-- | arch/s390/include/asm/dwarf.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/s390/include/asm/dwarf.h b/arch/s390/include/asm/dwarf.h new file mode 100644 index 000000000000..dffdb81e534f --- /dev/null +++ b/arch/s390/include/asm/dwarf.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_S390_DWARF_H +#define _ASM_S390_DWARF_H + +#ifdef __ASSEMBLY__ + +#ifndef BUILD_VDSO + /* + * Emit CFI data in .debug_frame sections and not in .eh_frame + * sections. The .eh_frame CFI is used for runtime unwind + * information that is not being used. Hence, vmlinux.lds.S + * can discard the .eh_frame sections. + */ + .cfi_sections .debug_frame +#else + /* + * For vDSO, emit CFI data in both, .eh_frame and .debug_frame + * sections. + */ + .cfi_sections .eh_frame, .debug_frame +#endif + +#endif /* __ASSEMBLY__ */ + +#endif /* _ASM_S390_DWARF_H */ |