arm64: vdso*: place got/plt sections in .rodata
authorJoey Gouly <joey.gouly@arm.com>
Tue, 28 Jun 2022 15:13:07 +0000 (16:13 +0100)
committerWill Deacon <will@kernel.org>
Tue, 28 Jun 2022 16:41:44 +0000 (17:41 +0100)
The vDSO will not contain absolute relocations, so place these
sections in .rodata.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Link: https://lore.kernel.org/linux-arm-kernel/00abb0c5-6360-0004-353f-e7a88b3bd22c@arm.com/
Cc: Will Deacon <will@kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20220628151307.35561-3-joey.gouly@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/vdso/vdso.lds.S
arch/arm64/kernel/vdso32/vdso.lds.S

index 1cd8525..e69fb4a 100644 (file)
@@ -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 = .);
index e2f8ced..6e67a65 100644 (file)
@@ -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*) }