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: Kees Cook <keescook@chromium.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: linux-arch@vger.kernel.org
Link: https://lore.kernel.org/r/20200821194310.3089815-5-keescook@chromium.org
This commit is contained in:
Kees Cook 2020-08-21 12:42:45 -07:00 committed by Ingo Molnar
parent d812db7828
commit c604abc3f6
24 changed files with 30 additions and 5 deletions

View File

@ -72,6 +72,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -122,6 +122,7 @@ SECTIONS
_end = . ;
STABS_DEBUG
ELF_DETAILS
DISCARDS
.arcextmap 0 : {

View File

@ -152,6 +152,7 @@ SECTIONS
_end = .;
STABS_DEBUG
ELF_DETAILS
}
/*

View File

@ -151,6 +151,7 @@ SECTIONS
_end = .;
STABS_DEBUG
ELF_DETAILS
}
#ifdef CONFIG_STRICT_KERNEL_RWX

View File

@ -241,6 +241,7 @@ SECTIONS
_end = .;
STABS_DEBUG
ELF_DETAILS
HEAD_SYMBOLS
}

View File

@ -109,6 +109,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -67,5 +67,6 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
}

View File

@ -218,6 +218,7 @@ SECTIONS {
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
/* Default discards */
DISCARDS

View File

@ -202,6 +202,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
/* These must appear regardless of . */
.gptab.sdata : {

View File

@ -64,6 +64,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -58,6 +58,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -115,6 +115,7 @@ SECTIONS
/* Throw in the debugging sections */
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
/* Sections to be discarded -- must be last */
DISCARDS

View File

@ -84,6 +84,7 @@ SECTIONS
}
STABS_DEBUG
ELF_DETAILS
.note 0 : { *(.note) }
/* Sections to be discarded */

View File

@ -164,6 +164,7 @@ SECTIONS
_end = . ;
STABS_DEBUG
ELF_DETAILS
.note 0 : { *(.note) }
/* Sections to be discarded */

View File

@ -360,8 +360,8 @@ SECTIONS
PROVIDE32 (end = .);
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
/DISCARD/ : {

View File

@ -97,6 +97,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -181,6 +181,7 @@ SECTIONS
/* Debugging sections. */
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
/* Sections to be discarded */
DISCARDS

View File

@ -76,6 +76,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -187,6 +187,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -164,8 +164,8 @@ SECTIONS
PROVIDE (end = .);
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -108,8 +108,8 @@ SECTIONS
PROVIDE (end = .);
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -82,6 +82,8 @@ SECTIONS
. = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
_end = .;
ELF_DETAILS
DISCARDS
}

View File

@ -411,6 +411,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
DISCARDS
}

View File

@ -34,6 +34,7 @@
*
* STABS_DEBUG
* DWARF_DEBUG
* ELF_DETAILS
*
* DISCARDS // must be the last
* }
@ -811,14 +812,17 @@
.debug_macro 0 : { *(.debug_macro) } \
.debug_addr 0 : { *(.debug_addr) }
/* Stabs debugging sections. */
/* Stabs debugging sections. */
#define STABS_DEBUG \
.stab 0 : { *(.stab) } \
.stabstr 0 : { *(.stabstr) } \
.stab.excl 0 : { *(.stab.excl) } \
.stab.exclstr 0 : { *(.stab.exclstr) } \
.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) }
#ifdef CONFIG_GENERIC_BUG