[RFC PATCH] riscv: vdso: remove hardcoded 0x800 .text section start addr

Jisheng Zhang jszhang at kernel.org
Wed Nov 23 08:18:05 PST 2022


It seems the hardcoded 0x800 isn't necessary, but removing it brings a
small vdso.so and aligns with other architectures.

Signed-off-by: Jisheng Zhang <jszhang at kernel.org>
---
 arch/riscv/kernel/vdso/vdso.lds.S | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S
index 150b1a572e61..7be7e618d59c 100644
--- a/arch/riscv/kernel/vdso/vdso.lds.S
+++ b/arch/riscv/kernel/vdso/vdso.lds.S
@@ -31,13 +31,7 @@ SECTIONS
 
 	.rodata		: { *(.rodata .rodata.* .gnu.linkonce.r.*) }
 
-	/*
-	 * This linker script is used both with -r and with -shared.
-	 * For the layouts to match, we need to skip more than enough
-	 * space for the dynamic symbol table, etc. If this amount is
-	 * insufficient, ld -shared will error; simply increase it here.
-	 */
-	. = 0x800;
+	. = ALIGN(4);
 	.text		: { *(.text .text.*) }		:text
 
 	.data		: {
-- 
2.37.2




More information about the linux-riscv mailing list