]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
x86/vmlinux: Drop unneeded linker script discard of .eh_frame
authorArvind Sankar <nivedita@alum.mit.edu>
Mon, 24 Feb 2020 23:21:29 +0000 (18:21 -0500)
committerBorislav Petkov <bp@suse.de>
Tue, 25 Feb 2020 13:51:29 +0000 (14:51 +0100)
Now that .eh_frame sections for the files in setup.elf and realmode.elf
are not generated anymore, the linker scripts don't need the special
output section name /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.

 [ bp: Touch up commit message. ]

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lkml.kernel.org/r/20200224232129.597160-3-nivedita@alum.mit.edu
arch/x86/boot/compressed/vmlinux.lds.S
arch/x86/boot/setup.ld
arch/x86/include/asm/dwarf2.h
arch/x86/kernel/vmlinux.lds.S
arch/x86/realmode/rm/realmode.lds.S

index 469dcf800a2c1c53f20c583ad3d891544174d643..508cfa6828c5d88cd8f616e28df686ec625dd5f5 100644 (file)
@@ -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)
-       }
 }
index 3da1c37c6dd533a9591168cc00e1c2211fb5211f..24c95522f231482abb1d52ba2dc575075d9f32bc 100644 (file)
@@ -52,7 +52,6 @@ SECTIONS
        _end = .;
 
        /DISCARD/       : {
-               *(.eh_frame)
                *(.note*)
        }
 
index ae391f6098403e498cb1aa80fb967ea7bde860d9..f71a0cce9373ae1995a149630eee85b6f89131e5 100644 (file)
@@ -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
index e3296aa028feb766ba79062d2acfe885becfd59b..5cab3a29adcbc596cbf940f4127aea481852acce 100644 (file)
@@ -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)
-       }
 }
 
 
index 64d135d1ee63edec38d20e87c421048d668eb722..63aa51875ba03b92b743a7f25b29b57f1dd7169c 100644 (file)
@@ -71,7 +71,6 @@ SECTIONS
        /DISCARD/ : {
                *(.note*)
                *(.debug*)
-               *(.eh_frame*)
        }
 
 #include "pasyms.h"