* [PATCH] x86: Use .cfi_sections
@ 2010-05-14 4:43 Roland McGrath
2010-05-14 5:48 ` [tip:x86/asm] x86: Use .cfi_sections for assembly code tip-bot for Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: Roland McGrath @ 2010-05-14 4:43 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin; +Cc: x86, linux-kernel
The following changes since commit 6a251b0ab67989f468f4cb65179e0cf40cf8c295:
Linus Torvalds (1):
Merge branch 'for-linus' of git://git.kernel.org/.../sameo/mfd-2.6
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland.git x86/cfi
Roland McGrath (1):
x86: Use .cfi_sections
arch/x86/Makefile | 5 +++--
arch/x86/include/asm/dwarf2.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
Thanks,
Roland
---
[PATCH] x86: Use .cfi_sections
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>
---
arch/x86/Makefile | 5 +++--
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 0a43dc5..8aa1b59 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -95,8 +95,9 @@ sp-$(CONFIG_X86_64) := rsp
cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1)
# is .cfi_signal_frame supported too?
cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1)
-KBUILD_AFLAGS += $(cfi) $(cfi-sigframe)
-KBUILD_CFLAGS += $(cfi) $(cfi-sigframe)
+cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1)
+KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections)
+KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections)
LDFLAGS := -m elf_$(UTS_MACHINE)
diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h
index ae6253a..733f7e9 100644
--- a/arch/x86/include/asm/dwarf2.h
+++ b/arch/x86/include/asm/dwarf2.h
@@ -34,6 +34,18 @@
#define CFI_SIGNAL_FRAME
#endif
+#if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__)
+ /*
+ * Emit CFI data in .debug_frame sections, not .eh_frame sections.
+ * The latter we currently just discard since we don't do DWARF
+ * unwinding at runtime. So only the offline DWARF information is
+ * useful to anyone. Note we should not use this directive if this
+ * file is used in the vDSO assembly, or if vmlinux.lds.S gets
+ * changed so it doesn't discard .eh_frame.
+ */
+ .cfi_sections .debug_frame
+#endif
+
#else
/*
^ permalink raw reply [flat|nested] 2+ messages in thread* [tip:x86/asm] x86: Use .cfi_sections for assembly code
2010-05-14 4:43 [PATCH] x86: Use .cfi_sections Roland McGrath
@ 2010-05-14 5:48 ` tip-bot for Roland McGrath
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Roland McGrath @ 2010-05-14 5:48 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, roland, tglx
Commit-ID: 9e565292270a2d55524be38835104c564ac8f795
Gitweb: http://git.kernel.org/tip/9e565292270a2d55524be38835104c564ac8f795
Author: Roland McGrath <roland@redhat.com>
AuthorDate: Thu, 13 May 2010 21:43:03 -0700
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Thu, 13 May 2010 22:15:18 -0700
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>
---
arch/x86/Makefile | 5 +++--
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 0a43dc5..8aa1b59 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -95,8 +95,9 @@ sp-$(CONFIG_X86_64) := rsp
cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1)
# is .cfi_signal_frame supported too?
cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1)
-KBUILD_AFLAGS += $(cfi) $(cfi-sigframe)
-KBUILD_CFLAGS += $(cfi) $(cfi-sigframe)
+cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1)
+KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections)
+KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections)
LDFLAGS := -m elf_$(UTS_MACHINE)
diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h
index ae6253a..733f7e9 100644
--- a/arch/x86/include/asm/dwarf2.h
+++ b/arch/x86/include/asm/dwarf2.h
@@ -34,6 +34,18 @@
#define CFI_SIGNAL_FRAME
#endif
+#if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__)
+ /*
+ * Emit CFI data in .debug_frame sections, not .eh_frame sections.
+ * The latter we currently just discard since we don't do DWARF
+ * unwinding at runtime. So only the offline DWARF information is
+ * useful to anyone. Note we should not use this directive if this
+ * file is used in the vDSO assembly, or if vmlinux.lds.S gets
+ * changed so it doesn't discard .eh_frame.
+ */
+ .cfi_sections .debug_frame
+#endif
+
#else
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-14 5:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-14 4:43 [PATCH] x86: Use .cfi_sections Roland McGrath
2010-05-14 5:48 ` [tip:x86/asm] x86: Use .cfi_sections for assembly code tip-bot for Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome