Skip to content

Commit 6e0a66d

Browse files
keesingomolnar
authored andcommitted
arm64/build: Remove .eh_frame* sections due to unwind tables
Avoid .eh_frame* section generation by making sure both CFLAGS and AFLAGS contain -fno-asychronous-unwind-tables and -fno-unwind-tables. With all sources of .eh_frame now removed from the build, drop this DISCARD so we can be alerted in the future if it returns unexpectedly once orphan section warnings have been enabled. Suggested-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20200821194310.3089815-11-keescook@chromium.org
1 parent 34b4a5c commit 6e0a66d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

arch/arm64/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ endif
4747

4848
KBUILD_CFLAGS += -mgeneral-regs-only \
4949
$(compat_vdso) $(cc_has_k_constraint)
50-
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
5150
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
5251
KBUILD_AFLAGS += $(compat_vdso)
5352

5453
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
5554
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
5655

56+
# Avoid generating .eh_frame* sections.
57+
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
58+
KBUILD_AFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
59+
5760
ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)
5861
prepare: stack_protector_prepare
5962
stack_protector_prepare: prepare0

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ SECTIONS
9494
*(.discard.*)
9595
*(.interp .dynamic)
9696
*(.dynsym .dynstr .hash .gnu.hash)
97-
*(.eh_frame)
9897
}
9998

10099
. = KIMAGE_VADDR + TEXT_OFFSET;

0 commit comments

Comments
 (0)