summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/vmlinux.lds.S
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2019-10-29 14:13:29 -0700
committerBorislav Petkov <bp@suse.de>2019-11-04 15:34:36 +0100
commit7a42d41d9dc2829bdf589db855ce3f948de2da6b (patch)
tree6e34bb771b62fb75b7e6011ebcab9026615673a4 /arch/x86/kernel/vmlinux.lds.S
parent6434efbd9aefa3786b446c8e4745d1f49d2983b4 (diff)
x86/vmlinux: Restore "text" Program Header with dummy section
In a linker script, if one 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 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 using a dummy section (as done by other architectures). Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: linux-alpha@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-c6x-dev@linux-c6x.org Cc: linux-ia64@vger.kernel.org Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Simek <monstr@monstr.eu> Cc: Rick Edgecombe <rick.p.edgecombe@intel.com> Cc: Segher Boessenkool <segher@kernel.crashing.org> Cc: Will Deacon <will@kernel.org> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20191029211351.13243-8-keescook@chromium.org
Diffstat (limited to 'arch/x86/kernel/vmlinux.lds.S')
-rw-r--r--arch/x86/kernel/vmlinux.lds.S3
1 files changed, 2 insertions, 1 deletions
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);