aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2015-10-05 20:47:58 -0400
committerIngo Molnar <mingo@kernel.org>2015-10-09 03:41:05 -0400
commitf24f910884277aa6824bbc2dda4b5d0418d45c28 (patch)
treeb11e8b917f953cc7d887fa7d079a8570e3939532
parent7b956f035a9ef8bd3ef5490f49fc1bd834d8a70a (diff)
x86/vdso: Define BUILD_VDSO while building and emit .eh_frame in asm
For the vDSO, user code wants runtime unwind info. Make sure that, if we use .cfi directives, we generate it. Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/16e29ad8855e6508197000d8c41f56adb00d7580.1444091584.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/entry/vdso/Makefile4
-rw-r--r--arch/x86/include/asm/dwarf2.h13
2 files changed, 12 insertions, 5 deletions
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 3bfb39e7b8b2..265c0ed68118 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -67,7 +67,7 @@ $(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE
67CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \ 67CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
68 $(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \ 68 $(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector) \
69 -fno-omit-frame-pointer -foptimize-sibling-calls \ 69 -fno-omit-frame-pointer -foptimize-sibling-calls \
70 -DDISABLE_BRANCH_PROFILING 70 -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
71 71
72$(vobjs): KBUILD_CFLAGS += $(CFL) 72$(vobjs): KBUILD_CFLAGS += $(CFL)
73 73
@@ -131,7 +131,7 @@ targets += vdso32/vdso32.lds
131targets += vdso32/note.o vdso32/vclock_gettime.o vdso32/system_call.o 131targets += vdso32/note.o vdso32/vclock_gettime.o vdso32/system_call.o
132targets += vdso32/vclock_gettime.o 132targets += vdso32/vclock_gettime.o
133 133
134KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS)) 134KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS)) -DBUILD_VDSO
135$(obj)/vdso32.so.dbg: KBUILD_AFLAGS = $(KBUILD_AFLAGS_32) 135$(obj)/vdso32.so.dbg: KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
136$(obj)/vdso32.so.dbg: asflags-$(CONFIG_X86_64) += -m32 136$(obj)/vdso32.so.dbg: asflags-$(CONFIG_X86_64) += -m32
137 137
diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h
index de1cdaf4d743..09133ba032b3 100644
--- a/arch/x86/include/asm/dwarf2.h
+++ b/arch/x86/include/asm/dwarf2.h
@@ -36,15 +36,22 @@
36#endif 36#endif
37 37
38#if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__) 38#if defined(CONFIG_AS_CFI_SECTIONS) && defined(__ASSEMBLY__)
39#ifndef BUILD_VDSO
39 /* 40 /*
40 * Emit CFI data in .debug_frame sections, not .eh_frame sections. 41 * Emit CFI data in .debug_frame sections, not .eh_frame sections.
41 * The latter we currently just discard since we don't do DWARF 42 * The latter we currently just discard since we don't do DWARF
42 * unwinding at runtime. So only the offline DWARF information is 43 * unwinding at runtime. So only the offline DWARF information is
43 * useful to anyone. Note we should not use this directive if this 44 * useful to anyone. Note we should not use this directive if
44 * file is used in the vDSO assembly, or if vmlinux.lds.S gets 45 * vmlinux.lds.S gets changed so it doesn't discard .eh_frame.
45 * changed so it doesn't discard .eh_frame.
46 */ 46 */
47 .cfi_sections .debug_frame 47 .cfi_sections .debug_frame
48#else
49 /*
50 * For the vDSO, emit both runtime unwind information and debug
51 * symbols for the .dbg file.
52 */
53 .cfi_sections .eh_frame, .debug_frame
54#endif
48#endif 55#endif
49 56
50#else 57#else