Commit c604abc3 authored by Kees Cook's avatar Kees Cook Committed by Ingo Molnar

vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG

The .comment section doesn't belong in STABS_DEBUG. Split it out into a
new macro named ELF_DETAILS. This will gain other non-debug sections
that need to be accounted for when linking with --orphan-handling=warn.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: linux-arch@vger.kernel.org
Link: https://lore.kernel.org/r/20200821194310.3089815-5-keescook@chromium.org
parent d812db78
...@@ -72,6 +72,7 @@ SECTIONS ...@@ -72,6 +72,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -122,6 +122,7 @@ SECTIONS ...@@ -122,6 +122,7 @@ SECTIONS
_end = . ; _end = . ;
STABS_DEBUG STABS_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
.arcextmap 0 : { .arcextmap 0 : {
......
...@@ -152,6 +152,7 @@ SECTIONS ...@@ -152,6 +152,7 @@ SECTIONS
_end = .; _end = .;
STABS_DEBUG STABS_DEBUG
ELF_DETAILS
} }
/* /*
......
...@@ -151,6 +151,7 @@ SECTIONS ...@@ -151,6 +151,7 @@ SECTIONS
_end = .; _end = .;
STABS_DEBUG STABS_DEBUG
ELF_DETAILS
} }
#ifdef CONFIG_STRICT_KERNEL_RWX #ifdef CONFIG_STRICT_KERNEL_RWX
......
...@@ -241,6 +241,7 @@ SECTIONS ...@@ -241,6 +241,7 @@ SECTIONS
_end = .; _end = .;
STABS_DEBUG STABS_DEBUG
ELF_DETAILS
HEAD_SYMBOLS HEAD_SYMBOLS
} }
......
...@@ -109,6 +109,7 @@ SECTIONS ...@@ -109,6 +109,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -67,5 +67,6 @@ SECTIONS ...@@ -67,5 +67,6 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
} }
...@@ -218,6 +218,7 @@ SECTIONS { ...@@ -218,6 +218,7 @@ SECTIONS {
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
/* Default discards */ /* Default discards */
DISCARDS DISCARDS
......
...@@ -202,6 +202,7 @@ SECTIONS ...@@ -202,6 +202,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
/* These must appear regardless of . */ /* These must appear regardless of . */
.gptab.sdata : { .gptab.sdata : {
......
...@@ -64,6 +64,7 @@ SECTIONS ...@@ -64,6 +64,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -58,6 +58,7 @@ SECTIONS ...@@ -58,6 +58,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -115,6 +115,7 @@ SECTIONS ...@@ -115,6 +115,7 @@ SECTIONS
/* Throw in the debugging sections */ /* Throw in the debugging sections */
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
/* Sections to be discarded -- must be last */ /* Sections to be discarded -- must be last */
DISCARDS DISCARDS
......
...@@ -84,6 +84,7 @@ SECTIONS ...@@ -84,6 +84,7 @@ SECTIONS
} }
STABS_DEBUG STABS_DEBUG
ELF_DETAILS
.note 0 : { *(.note) } .note 0 : { *(.note) }
/* Sections to be discarded */ /* Sections to be discarded */
......
...@@ -164,6 +164,7 @@ SECTIONS ...@@ -164,6 +164,7 @@ SECTIONS
_end = . ; _end = . ;
STABS_DEBUG STABS_DEBUG
ELF_DETAILS
.note 0 : { *(.note) } .note 0 : { *(.note) }
/* Sections to be discarded */ /* Sections to be discarded */
......
...@@ -360,8 +360,8 @@ SECTIONS ...@@ -360,8 +360,8 @@ SECTIONS
PROVIDE32 (end = .); PROVIDE32 (end = .);
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
/DISCARD/ : { /DISCARD/ : {
......
...@@ -97,6 +97,7 @@ SECTIONS ...@@ -97,6 +97,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -181,6 +181,7 @@ SECTIONS ...@@ -181,6 +181,7 @@ SECTIONS
/* Debugging sections. */ /* Debugging sections. */
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
/* Sections to be discarded */ /* Sections to be discarded */
DISCARDS DISCARDS
......
...@@ -76,6 +76,7 @@ SECTIONS ...@@ -76,6 +76,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -187,6 +187,7 @@ SECTIONS ...@@ -187,6 +187,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -164,8 +164,8 @@ SECTIONS ...@@ -164,8 +164,8 @@ SECTIONS
PROVIDE (end = .); PROVIDE (end = .);
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -108,8 +108,8 @@ SECTIONS ...@@ -108,8 +108,8 @@ SECTIONS
PROVIDE (end = .); PROVIDE (end = .);
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
...@@ -82,6 +82,8 @@ SECTIONS ...@@ -82,6 +82,8 @@ SECTIONS
. = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */ . = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
_end = .; _end = .;
ELF_DETAILS
DISCARDS DISCARDS
} }
......
...@@ -411,6 +411,7 @@ SECTIONS ...@@ -411,6 +411,7 @@ SECTIONS
STABS_DEBUG STABS_DEBUG
DWARF_DEBUG DWARF_DEBUG
ELF_DETAILS
DISCARDS DISCARDS
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
* *
* STABS_DEBUG * STABS_DEBUG
* DWARF_DEBUG * DWARF_DEBUG
* ELF_DETAILS
* *
* DISCARDS // must be the last * DISCARDS // must be the last
* } * }
...@@ -811,14 +812,17 @@ ...@@ -811,14 +812,17 @@
.debug_macro 0 : { *(.debug_macro) } \ .debug_macro 0 : { *(.debug_macro) } \
.debug_addr 0 : { *(.debug_addr) } .debug_addr 0 : { *(.debug_addr) }
/* Stabs debugging sections. */ /* Stabs debugging sections. */
#define STABS_DEBUG \ #define STABS_DEBUG \
.stab 0 : { *(.stab) } \ .stab 0 : { *(.stab) } \
.stabstr 0 : { *(.stabstr) } \ .stabstr 0 : { *(.stabstr) } \
.stab.excl 0 : { *(.stab.excl) } \ .stab.excl 0 : { *(.stab.excl) } \
.stab.exclstr 0 : { *(.stab.exclstr) } \ .stab.exclstr 0 : { *(.stab.exclstr) } \
.stab.index 0 : { *(.stab.index) } \ .stab.index 0 : { *(.stab.index) } \
.stab.indexstr 0 : { *(.stab.indexstr) } \ .stab.indexstr 0 : { *(.stab.indexstr) }
/* Required sections not related to debugging. */
#define ELF_DETAILS \
.comment 0 : { *(.comment) } .comment 0 : { *(.comment) }
#ifdef CONFIG_GENERIC_BUG #ifdef CONFIG_GENERIC_BUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment