Debian Codegraph @

vmtest/patches/4.9-arm64-build-Remove-.eh_frame-sections-due-to-unwind-.patch

raw
1 From a099169787363c34a61420d67061ff7a354e5de3 Mon Sep 17 00:00:00 2001
2 Message-ID: <a099169787363c34a61420d67061ff7a354e5de3.1709837609.git.osandov@osandov.com>
3 From: Kees Cook <[email protected]>
4 Date: Fri, 21 Aug 2020 12:42:51 -0700
5 Subject: [PATCH] arm64/build: Remove .eh_frame* sections due to unwind tables
6
7 Avoid .eh_frame* section generation by making sure both CFLAGS and AFLAGS
8 contain -fno-asychronous-unwind-tables and -fno-unwind-tables.
9
10 With all sources of .eh_frame now removed from the build, drop this
11 DISCARD so we can be alerted in the future if it returns unexpectedly
12 once orphan section warnings have been enabled.
13
14 Suggested-by: Ard Biesheuvel <[email protected]>
15 Signed-off-by: Kees Cook <[email protected]>
16 Signed-off-by: Ingo Molnar <[email protected]>
17 Acked-by: Will Deacon <[email protected]>
18 Link: https://lore.kernel.org/r/[email protected]
19 (cherry picked from commit 6e0a66d10c5b629369afa47b753d0ec46fa812dd)
20 Signed-off-by: Omar Sandoval <[email protected]>
21 ---
22 arch/arm64/Makefile | 5 ++++-
23 1 file changed, 4 insertions(+), 1 deletion(-)
24
25 diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
26 index 8d469aa5fc98..d3fa0465765d 100644
27 --- a/arch/arm64/Makefile
28 +++ b/arch/arm64/Makefile
29 @@ -42,10 +42,13 @@ $(warning LSE atomics not supported by binutils)
30 endif
31
32 KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr)
33 -KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
34 KBUILD_CFLAGS += $(call cc-option, -mpc-relative-literal-loads)
35 KBUILD_AFLAGS += $(lseinstr)
36
37 +# Avoid generating .eh_frame* sections.
38 +KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
39 +KBUILD_AFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
40 +
41 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
42 KBUILD_CPPFLAGS += -mbig-endian
43 AS += -EB
44 --
45 2.44.0
46