[PATCH] powerpc: Add support for BUILD_SALT in kernel, modules & VDSO
From: Michael Ellerman
Date: Tue Jun 12 2018 - 00:52:34 EST
This patch adds support for BUILD_SALT in the kernel, modules and
VDSO. See the commit that adds BUILD_SALT for more info.
Kernel:
0:mon> d c000000001340840
c000000001340840 0055aaff12345678 1234567812345678 |.U...4Vx.4Vx.4Vx|
c000000001340850 1234567812345678 1234567812345678 |.4Vx.4Vx.4Vx.4Vx|
Module:
$ cat/sys/module/kvm/sections/.salt
0xd0000000064385e8
...
0:mon> d d0000000064385e8
d0000000064385e8 0055aaff12345678 1234567812345678 |.U...4Vx.4Vx.4Vx|
d0000000064385f8 1234567812345678 1234567812345678 |.4Vx.4Vx.4Vx.4Vx|
vdso:
(gdb) x/4xw (0x7ffff7f80000 + 0x4a0)
0x7ffff7f804a0: 0xffaa5500 0x78563412 0x78563412 0x78563412
Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
---
arch/powerpc/kernel/vdso32/vdso32.lds.S | 2 ++
arch/powerpc/kernel/vdso64/vdso64.lds.S | 2 ++
arch/powerpc/kernel/vmlinux.lds.S | 1 +
3 files changed, 5 insertions(+)
diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S
index 099a6db14e67..c06a12607777 100644
--- a/arch/powerpc/kernel/vdso32/vdso32.lds.S
+++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S
@@ -4,6 +4,7 @@
* library
*/
#include <asm/vdso.h>
+#include <asm-generic/vmlinux.lds.h>
#ifdef __LITTLE_ENDIAN__
OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle")
@@ -25,6 +26,7 @@ SECTIONS
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
+ BUILD_SALT
.note : { *(.note.*) } :text :note
. = ALIGN(16);
diff --git a/arch/powerpc/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S
index 256fb9720298..ace69258446a 100644
--- a/arch/powerpc/kernel/vdso64/vdso64.lds.S
+++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S
@@ -4,6 +4,7 @@
* library
*/
#include <asm/vdso.h>
+#include <asm-generic/vmlinux.lds.h>
#ifdef __LITTLE_ENDIAN__
OUTPUT_FORMAT("elf64-powerpcle", "elf64-powerpcle", "elf64-powerpcle")
@@ -25,6 +26,7 @@ SECTIONS
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
+ BUILD_SALT
.note : { *(.note.*) } :text :note
. = ALIGN(16);
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 5baac79df97e..59635369ceea 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -348,6 +348,7 @@ SECTIONS
}
BUG_TABLE
+ BUILD_SALT
. = ALIGN(PAGE_SIZE);
_edata = .;
--
2.14.1