Skip to content

Commit 6f8f0dc

Browse files
nivedita76suryasaimadhu
authored andcommitted
x86/vmlinux: Drop unneeded linker script discard of .eh_frame
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Kees Cook <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 003602a commit 6f8f0dc

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

arch/x86/boot/compressed/vmlinux.lds.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,4 @@ SECTIONS
7373
#endif
7474
. = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
7575
_end = .;
76-
77-
/* Discard .eh_frame to save some space */
78-
/DISCARD/ : {
79-
*(.eh_frame)
80-
}
8176
}

arch/x86/boot/setup.ld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ SECTIONS
5252
_end = .;
5353

5454
/DISCARD/ : {
55-
*(.eh_frame)
5655
*(.note*)
5756
}
5857

arch/x86/include/asm/dwarf2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
* Emit CFI data in .debug_frame sections, not .eh_frame sections.
4343
* The latter we currently just discard since we don't do DWARF
4444
* unwinding at runtime. So only the offline DWARF information is
45-
* useful to anyone. Note we should not use this directive if
46-
* vmlinux.lds.S gets changed so it doesn't discard .eh_frame.
45+
* useful to anyone. Note we should not use this directive if we
46+
* ever decide to enable DWARF unwinding at runtime.
4747
*/
4848
.cfi_sections .debug_frame
4949
#else

arch/x86/kernel/vmlinux.lds.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ SECTIONS
313313

314314
. = ALIGN(8);
315315
/*
316-
* .exit.text is discard at runtime, not link time, to deal with
317-
* references from .altinstructions and .eh_frame
316+
* .exit.text is discarded at runtime, not link time, to deal with
317+
* references from .altinstructions
318318
*/
319319
.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
320320
EXIT_TEXT
@@ -412,9 +412,6 @@ SECTIONS
412412
DWARF_DEBUG
413413

414414
DISCARDS
415-
/DISCARD/ : {
416-
*(.eh_frame)
417-
}
418415
}
419416

420417

arch/x86/realmode/rm/realmode.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ SECTIONS
7171
/DISCARD/ : {
7272
*(.note*)
7373
*(.debug*)
74-
*(.eh_frame*)
7574
}
7675

7776
#include "pasyms.h"

0 commit comments

Comments
 (0)