arm/build: Explicitly keep .ARM.attributes sections

In preparation for adding --orphan-handling=warn, explicitly keep the
.ARM.attributes section (at address 0[1]) by expanding the existing
ELF_DETAILS macro into ARM_DETAILS.

[1] https://reviews.llvm.org/D85867

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Fangrui Song <maskray@google.com>
Cc: Russell King <linux@armlinux.org.uk>
Link: https://lore.kernel.org/lkml/CAKwvOdk-racgq5pxsoGS6Vtifbtrk5fmkmnoLxrQMaOvV0nPWw@mail.gmail.com/
Link: https://lore.kernel.org/r/20200821194310.3089815-17-keescook@chromium.org
This commit is contained in:
Kees Cook 2020-08-21 12:42:57 -07:00 committed by Ingo Molnar
parent d7e3b065dc
commit 3b14aefb84
3 changed files with 6 additions and 2 deletions

View file

@ -52,6 +52,10 @@
ARM_MMU_DISCARD(*(__ex_table)) \
COMMON_DISCARDS
#define ARM_DETAILS \
ELF_DETAILS \
.ARM.attributes 0 : { *(.ARM.attributes) }
#define ARM_STUBS_TEXT \
*(.gnu.warning) \
*(.glue_7) \

View file

@ -150,7 +150,7 @@ SECTIONS
_end = .;
STABS_DEBUG
ELF_DETAILS
ARM_DETAILS
}
/*

View file

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