[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdm1yGkYtiqHqDvi_e+jSdbp102AbPsaXG42fR4Tyw42Aw@mail.gmail.com>
Date: Mon, 24 Feb 2020 15:33:55 -0800
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Arvind Sankar <nivedita@...m.mit.edu>
Cc: Borislav Petkov <bp@...en8.de>,
Nathan Chancellor <natechancellor@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Michael Matz <matz@...e.de>, Fangrui Song <maskray@...gle.com>,
Kees Cook <keescook@...omium.org>,
Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH v2 2/2] arch/x86: Drop unneeded linker script discard of .eh_frame
On Mon, Feb 24, 2020 at 3:21 PM Arvind Sankar <nivedita@...m.mit.edu> wrote:
>
> Now that we don't generate .eh_frame sections for the files in setup.elf
> and realmode.elf, the linker scripts don't need the /DISCARD/ any more.
>
> Remove the one in the main kernel linker script as well, since there are
> no .eh_frame sections already, and fix up a comment referencing .eh_frame.
>
> Update the comment in asm/dwarf2.h referring to .eh_frame so it continues
> to make sense, as well as being more specific.
>
> Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
Thanks for cleaning up the comments.
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
> ---
> arch/x86/boot/compressed/vmlinux.lds.S | 5 -----
> arch/x86/boot/setup.ld | 1 -
> arch/x86/include/asm/dwarf2.h | 4 ++--
> arch/x86/kernel/vmlinux.lds.S | 7 ++-----
> arch/x86/realmode/rm/realmode.lds.S | 1 -
> 5 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
> index 469dcf800a2c..508cfa6828c5 100644
> --- a/arch/x86/boot/compressed/vmlinux.lds.S
> +++ b/arch/x86/boot/compressed/vmlinux.lds.S
> @@ -73,9 +73,4 @@ SECTIONS
> #endif
> . = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
> _end = .;
> -
> - /* Discard .eh_frame to save some space */
> - /DISCARD/ : {
> - *(.eh_frame)
> - }
> }
> diff --git a/arch/x86/boot/setup.ld b/arch/x86/boot/setup.ld
> index 3da1c37c6dd5..24c95522f231 100644
> --- a/arch/x86/boot/setup.ld
> +++ b/arch/x86/boot/setup.ld
> @@ -52,7 +52,6 @@ SECTIONS
> _end = .;
>
> /DISCARD/ : {
> - *(.eh_frame)
> *(.note*)
> }
>
> diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h
> index ae391f609840..f71a0cce9373 100644
> --- a/arch/x86/include/asm/dwarf2.h
> +++ b/arch/x86/include/asm/dwarf2.h
> @@ -42,8 +42,8 @@
> * Emit CFI data in .debug_frame sections, not .eh_frame sections.
> * The latter we currently just discard since we don't do DWARF
> * unwinding at runtime. So only the offline DWARF information is
> - * useful to anyone. Note we should not use this directive if
> - * vmlinux.lds.S gets changed so it doesn't discard .eh_frame.
> + * useful to anyone. Note we should not use this directive if we
> + * ever decide to enable DWARF unwinding at runtime.
> */
> .cfi_sections .debug_frame
> #else
> diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
> index e3296aa028fe..5cab3a29adcb 100644
> --- a/arch/x86/kernel/vmlinux.lds.S
> +++ b/arch/x86/kernel/vmlinux.lds.S
> @@ -313,8 +313,8 @@ SECTIONS
>
> . = ALIGN(8);
> /*
> - * .exit.text is discard at runtime, not link time, to deal with
> - * references from .altinstructions and .eh_frame
> + * .exit.text is discarded at runtime, not link time, to deal with
> + * references from .altinstructions
> */
> .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
> EXIT_TEXT
> @@ -412,9 +412,6 @@ SECTIONS
> DWARF_DEBUG
>
> DISCARDS
> - /DISCARD/ : {
> - *(.eh_frame)
> - }
> }
>
>
> diff --git a/arch/x86/realmode/rm/realmode.lds.S b/arch/x86/realmode/rm/realmode.lds.S
> index 64d135d1ee63..63aa51875ba0 100644
> --- a/arch/x86/realmode/rm/realmode.lds.S
> +++ b/arch/x86/realmode/rm/realmode.lds.S
> @@ -71,7 +71,6 @@ SECTIONS
> /DISCARD/ : {
> *(.note*)
> *(.debug*)
> - *(.eh_frame*)
> }
>
> #include "pasyms.h"
> --
> 2.24.1
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists