Skip to content

Commit 7e8c4ed

Browse files
keesIngo Molnar
authored andcommitted
arm/boot: Handle all sections explicitly
In preparation for warning on orphan sections, use common macros for debug sections, discards, and text stubs. Add discards for unwanted .note, and .rel sections. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Russell King <linux@armlinux.org.uk> Link: https://lore.kernel.org/r/20200821194310.3089815-21-keescook@chromium.org
1 parent 0c918e7 commit 7e8c4ed

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* Copyright (C) 2000 Russell King
44
*/
5+
#include <asm/vmlinux.lds.h>
56

67
#ifdef CONFIG_CPU_ENDIAN_BE8
78
#define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \
@@ -17,8 +18,11 @@ ENTRY(_start)
1718
SECTIONS
1819
{
1920
/DISCARD/ : {
21+
COMMON_DISCARDS
2022
*(.ARM.exidx*)
2123
*(.ARM.extab*)
24+
*(.note.*)
25+
*(.rel.*)
2226
/*
2327
* Discard any r/w data - this produces a link error if we have any,
2428
* which is required for PIC decompression. Local data generates
@@ -36,9 +40,7 @@ SECTIONS
3640
*(.start)
3741
*(.text)
3842
*(.text.*)
39-
*(.gnu.warning)
40-
*(.glue_7t)
41-
*(.glue_7)
43+
ARM_STUBS_TEXT
4244
}
4345
.table : ALIGN(4) {
4446
_table_start = .;
@@ -128,12 +130,10 @@ SECTIONS
128130
PROVIDE(__pecoff_data_size = ALIGN(512) - ADDR(.data));
129131
PROVIDE(__pecoff_end = ALIGN(512));
130132

131-
.stab 0 : { *(.stab) }
132-
.stabstr 0 : { *(.stabstr) }
133-
.stab.excl 0 : { *(.stab.excl) }
134-
.stab.exclstr 0 : { *(.stab.exclstr) }
135-
.stab.index 0 : { *(.stab.index) }
136-
.stab.indexstr 0 : { *(.stab.indexstr) }
137-
.comment 0 : { *(.comment) }
133+
STABS_DEBUG
134+
DWARF_DEBUG
135+
ARM_DETAILS
136+
137+
ARM_ASSERTS
138138
}
139139
ASSERT(_edata_real == _edata, "error: zImage file size is incorrect");

0 commit comments

Comments
 (0)