[PATCH v2 07/29] x86: Restore "text" Program Header with dummy section
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Borislav Petkov <bp@xxxxxxxxx>
- Subject: [PATCH v2 07/29] x86: Restore "text" Program Header with dummy section
- From: Kees Cook <keescook@xxxxxxxxxxxx>
- Date: Thu, 10 Oct 2019 17:05:47 -0700
- Cc: Kees Cook <keescook@xxxxxxxxxxxx>, Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, linux-arch@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-c6x-dev@xxxxxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, linux-parisc@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- In-reply-to: <20191011000609.29728-1-keescook@chromium.org>
- References: <20191011000609.29728-1-keescook@chromium.org>
In a linker script, if once places a section in one or more segments using
":PHDR", then the linker will place all subsequent allocatable sections,
which do not specify ":PHDR", into the same segments. In order to have
the NOTES section in both PT_LOAD (":text") and PT_NOTE (":note"), both
segments are marked, and the only way to to undo this to keep subsequent
sections out of PT_NOTE is to mark the following section with just the
single desired PT_LOAD (":text").
In preparation for having a common NOTES macro, perform the segment
assignment use a dummy section (as done by other architectures).
Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
---
arch/x86/kernel/vmlinux.lds.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index e2feacf921a0..788e78978030 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -147,8 +147,9 @@ SECTIONS
} :text = 0x9090
NOTES :text :note
+ .dummy : { *(.dummy) } :text
- EXCEPTION_TABLE(16) :text = 0x9090
+ EXCEPTION_TABLE(16)
/* .text should occupy whole number of pages */
. = ALIGN(PAGE_SIZE);
--
2.17.1
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]