Re: [PATCH v2 1/2] arch/x86: Use -fno-asynchronous-unwind-tables to suppress .eh_frame sections

From: Nathan Chancellor
Date: Mon Feb 24 2020 - 18:28:48 EST


On Mon, Feb 24, 2020 at 06:21:28PM -0500, Arvind Sankar wrote:
> While discussing a patch to discard .eh_frame from the compressed
> vmlinux using the linker script, Fangrui Song pointed out [1] that these
> sections shouldn't exist in the first place because arch/x86/Makefile
> uses -fno-asynchronous-unwind-tables.
>
> It turns out this is because the Makefiles used to build the compressed
> kernel redefine KBUILD_CFLAGS, dropping this flag.
>
> Add the flag to the Makefile for the compressed kernel, as well as the
> EFI stub Makefile to fix this.
>
> Also add the flag to boot/Makefile and realmode/rm/Makefile so that the
> kernel's boot code (boot/setup.elf) and realmode trampoline
> (realmode/rm/realmode.elf) won't be compiled with .eh_frame sections,
> since their linker scripts also just discard it.
>
> Signed-off-by: Arvind Sankar <nivedita@xxxxxxxxxxxx>
> Suggested-By: Fangrui Song <maskray@xxxxxxxxxx>
> [1] https://lore.kernel.org/lkml/20200222185806.ywnqhfqmy67akfsa@xxxxxxxxxx/

My previous review conments still stand,

Reviewed-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
Tested-by: Nathan Chancellor <natechancellor@xxxxxxxxx>