[PATCH v5 3/4] arm64: vdso32: put ELF related sections in the linker script

Joey Gouly joey.gouly at arm.com
Tue May 10 02:58:33 PDT 2022


Use macros from vmlinux.lds.h to explicitly name sections that are included
in the compat VDSO32 output.

Signed-off-by: Joey Gouly <joey.gouly at arm.com>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Will Deacon <will at kernel.org>
Cc: Masahiro Yamada <masahiroy at kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino at arm.com>
Cc: Kees Cook <keescook at chromium.org>
Reviewed-by: Kees Cook <keescook at chromium.org>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino at arm.com>
---
 arch/arm64/kernel/vdso32/vdso.lds.S | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/vdso.lds.S
index 3348ce5ea306..120cf422036f 100644
--- a/arch/arm64/kernel/vdso32/vdso.lds.S
+++ b/arch/arm64/kernel/vdso32/vdso.lds.S
@@ -11,6 +11,7 @@
 #include <linux/const.h>
 #include <asm/page.h>
 #include <asm/vdso.h>
+#include <asm-generic/vmlinux.lds.h>
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
@@ -37,10 +38,29 @@ SECTIONS
 
 	.rodata		: { *(.rodata*) }		:text
 
-	.text		: { *(.text*) }			:text	=0xe7f001f2
+	.text		: {
+		*(.text*)
+		*(.glue_7)
+		*(.glue_7t)
+		*(.vfp11_veneer)
+		*(.v4_bx)
+	}						:text	=0xe7f001f2
+
+	.rel.dyn	: { *(.rel.text) }
 
 	.got		: { *(.got) }
+	.rel.got	: { *(.rel.got) }
+	.got.plt	: { *(.got.plt) }
 	.rel.plt	: { *(.rel.plt) }
+	.plt		: {
+		*(.plt)
+		*(.rel.iplt)
+		*(.iplt)
+		*(.igot.plt)
+	}
+
+	ELF_DETAILS
+	.ARM.attributes 0 : { *(.ARM.attributes) }
 
 	/DISCARD/	: {
 		*(.note.GNU-stack)
-- 
2.17.1




More information about the linux-arm-kernel mailing list