diff options
author | Roland McGrath <roland@redhat.com> | 2010-05-14 00:43:03 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-05-14 01:15:18 -0400 |
commit | 9e565292270a2d55524be38835104c564ac8f795 (patch) | |
tree | a4a2c6e5b2013e142b866b1f4dcca44a8f7384a4 | |
parent | 5967ed87ade85a421ef814296c3c7f182b08c225 (diff) |
x86: Use .cfi_sections for assembly code
The newer assemblers support the .cfi_sections directive so we can put
the CFI from .S files into the .debug_frame section that is preserved
in unstripped vmlinux and in separate debuginfo, rather than the
.eh_frame section that is now discarded by vmlinux.lds.S.
Signed-off-by: Roland McGrath <roland@redhat.com>
LKML-Reference: <20100514044303.A6FE7400BE@magilla.sf.frob.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/dwarf2.h | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 0a43dc515e4c..8aa1b59b9074 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -95,8 +95,9 @@ sp-$(CONFIG_X86_64) := rsp | |||
95 | cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1) | 95 | cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1) |
96 | # is .cfi_signal_frame supported too? | 96 | # is .cfi_signal_frame supported too? |
97 | cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1) | 97 | cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1) |
98 | KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) | 98 | cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1) |
99 | KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) | 99 | KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) |
100 | KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) | ||
100 | 101 | ||
101 | LDFLAGS := -m elf_$(UTS_MACHINE) | 102 | LDFLAGS := -m elf_$(UTS_MACHINE) |
102 | 103 | ||
diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index ae6253ab9029..733f7e91e7a9 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h | |||
@@ -34,6 +34,18 @@ | |||
34 | #define CFI_SIGNAL_FRAME | 34 | #define CFI_SIGNAL_FRAME |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__) | ||
38 | /* | ||
39 | * Emit CFI data in .debug_frame sections, not .eh_frame sections. | ||
40 | * The latter we currently just discard since we don't do DWARF | ||
41 | * unwinding at runtime. So only the offline DWARF information is | ||
42 | * useful to anyone. Note we should not use this directive if this | ||
43 | * file is used in the vDSO assembly, or if vmlinux.lds.S gets | ||
44 | * changed so it doesn't discard .eh_frame. | ||
45 | */ | ||
46 | .cfi_sections .debug_frame | ||
47 | #endif | ||
48 | |||
37 | #else | 49 | #else |
38 | 50 | ||
39 | /* | 51 | /* |