[PATCH v1 2/2] arm64: vdso*: place got/plt sections in .rodata

Joey Gouly joey.gouly at arm.com
Tue Jun 28 08:13:07 PDT 2022


The vDSO will not contain absolute relocations, so place these
sections in .rodata.

Signed-off-by: Joey Gouly <joey.gouly at arm.com>
Link: https://lore.kernel.org/linux-arm-kernel/00abb0c5-6360-0004-353f-e7a88b3bd22c@arm.com/
Cc: Will Deacon <will at kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino at arm.com>
---
 arch/arm64/kernel/vdso/vdso.lds.S   | 12 +++++-------
 arch/arm64/kernel/vdso32/vdso.lds.S | 23 ++++++++++-------------
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
index 1cd85258c079..e69fb4aaaf3e 100644
--- a/arch/arm64/kernel/vdso/vdso.lds.S
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
@@ -52,17 +52,15 @@ SECTIONS
 
 	.rela.dyn	: ALIGN(8) { *(.rela .rela*) }
 
-	.plt		: {
+	.rodata		: {
+		*(.rodata*)
+		*(.got)
+		*(.got.plt)
 		*(.plt)
 		*(.plt.*)
 		*(.iplt)
 		*(.igot .igot.plt)
-	}
-
-	.got		: { *(.got) }
-	.got.plt	: { *(.got.plt) }
-
-	.rodata		: { *(.rodata*) }		:text
+	}						:text
 
 	_end = .;
 	PROVIDE(end = .);
diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/vdso.lds.S
index e2f8ced571d6..6e67a6524d58 100644
--- a/arch/arm64/kernel/vdso32/vdso.lds.S
+++ b/arch/arm64/kernel/vdso32/vdso.lds.S
@@ -36,7 +36,15 @@ SECTIONS
 
 	.dynamic	: { *(.dynamic) }		:text	:dynamic
 
-	.rodata		: { *(.rodata*) }		:text
+	.rodata		: {
+		*(.rodata*)
+		*(.got)
+		*(.got.plt)
+		*(.plt)
+		*(.rel.iplt)
+		*(.iplt)
+		*(.igot.plt)
+	}						:text
 
 	.text		: {
 		*(.text*)
@@ -46,18 +54,7 @@ SECTIONS
 		*(.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)
-	}
+	.rel.dyn	: { *(.rel*) }
 
 	ELF_DETAILS
 	.ARM.exidx : { *(.ARM.exidx*) }
-- 
2.17.1




More information about the linux-arm-kernel mailing list