powerpc/vdso: Don't discard rela sections
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 20 Aug 2024 11:28:07 +0000 (13:28 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 22 Aug 2024 12:52:29 +0000 (22:52 +1000)
After building the VDSO, there is a verification that it contains
no dynamic relocation, see commit aff69273af61 ("vdso: Improve
cmd_vdso_check to check all dynamic relocations").

This verification uses readelf -r and doesn't work if rela sections
are discarded.

Fixes: 8ad57add77d3 ("powerpc/build: vdso linker warning for orphan sections")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/45c3e6fc76cad05ad2cac0f5b5dfb4fae86dc9d6.1724153239.git.christophe.leroy@csgroup.eu
arch/powerpc/kernel/vdso/vdso32.lds.S
arch/powerpc/kernel/vdso/vdso64.lds.S

index 426e1ccc6971a3832dd0afe18bc7c8aec295b22f..8f57107000a247af942f5995ce9c2706164038b9 100644 (file)
@@ -74,6 +74,8 @@ SECTIONS
        .got            : { *(.got) }                   :text
        .plt            : { *(.plt) }
 
+       .rela.dyn       : { *(.rela .rela*) }
+
        _end = .;
        __end = .;
        PROVIDE(end = .);
@@ -87,7 +89,7 @@ SECTIONS
                *(.branch_lt)
                *(.data .data.* .gnu.linkonce.d.* .sdata*)
                *(.bss .sbss .dynbss .dynsbss)
-               *(.got1 .glink .iplt .rela*)
+               *(.got1 .glink .iplt)
        }
 }
 
index bda6c8cdd459c0004a386c23e4f5149517752778..400819258c06b71c8d9601c0c29cc08e5687cb4d 100644 (file)
@@ -69,7 +69,7 @@ SECTIONS
        .eh_frame_hdr   : { *(.eh_frame_hdr) }          :text   :eh_frame_hdr
        .eh_frame       : { KEEP (*(.eh_frame)) }       :text
        .gcc_except_table : { *(.gcc_except_table) }
-       .rela.dyn ALIGN(8) : { *(.rela.dyn) }
+       .rela.dyn ALIGN(8) : { *(.rela .rela*) }
 
        .got ALIGN(8)   : { *(.got .toc) }
 
@@ -86,7 +86,7 @@ SECTIONS
                *(.data .data.* .gnu.linkonce.d.* .sdata*)
                *(.bss .sbss .dynbss .dynsbss)
                *(.opd)
-               *(.glink .iplt .plt .rela*)
+               *(.glink .iplt .plt)
        }
 }