[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200224041542.GA55909@ubuntu-m2-xlarge-x86>
Date: Sun, 23 Feb 2020 21:15:42 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: Arvind Sankar <nivedita@...m.mit.edu>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com,
Michael Matz <matz@...e.de>, Fangrui Song <maskray@...gle.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH 0/2] Stop generating .eh_frame sections
On Sun, Feb 23, 2020 at 02:37:13PM -0500, Arvind Sankar wrote:
> In three places in the x86 kernel we are currently generating .eh_frame
> sections only to discard them later via linker script. This is in the
> boot code (setup.elf), the realmode trampoline (realmode.elf) and the
> compressed kernel.
>
> Implement Fangrui and Nick's suggestion [1] to fix KBUILD_CFLAGS by
> adding -fno-asynchronous-unwind-tables to avoid generating .eh_frame
> sections in the first place, rather than discarding it in the linker
> script.
>
> Arvind Sankar (2):
> arch/x86: Use -fno-asynchronous-unwind-tables to suppress .eh_frame sections
> arch/x86: Drop unneeded linker script discard of .eh_frame
>
> arch/x86/boot/Makefile | 1 +
> arch/x86/boot/compressed/Makefile | 1 +
> arch/x86/boot/setup.ld | 1 -
> arch/x86/kernel/vmlinux.lds.S | 3 ---
> arch/x86/realmode/rm/Makefile | 1 +
> arch/x86/realmode/rm/realmode.lds.S | 1 -
> drivers/firmware/efi/libstub/Makefile | 3 ++-
> 7 files changed, 5 insertions(+), 6 deletions(-)
>
> --
> 2.24.1
>
With both of these patches applied on top of next-20200221 and a revert
of commit e11831d0ada3 ("x86/boot/compressed: Remove unnecessary
sections from bzImage"), I do not see any .eh_frame sections in the
following files:
$ readelf -S arch/x86/boot/setup.elf \
arch/x86/realmode/rm/realmode.elf \
arch/x86/boot/compressed/vmlinux \
vmlinux |& grep eh_frame
Additionally, I can see -fno-asynchronous-unwind-tables get added to
files that didn't previously have it.
Reviewed-by: Nathan Chancellor <natechancellor@...il.com>
Tested-by: Nathan Chancellor <natechancellor@...il.com>
Powered by blists - more mailing lists