Skip to content

Commit

Permalink
powerpc/vdso: Don't discard rela sections
Browse files Browse the repository at this point in the history
[ Upstream commit 6114139 ]

After building the VDSO, there is a verification that it contains
no dynamic relocation, see commit aff6927 ("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: 8ad57ad ("powerpc/build: vdso linker warning for orphan sections")
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/45c3e6fc76cad05ad2cac0f5b5dfb4fae86dc9d6.1724153239.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
chleroy authored and gregkh committed Sep 12, 2024
1 parent 547acc2 commit af4d563
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion arch/powerpc/kernel/vdso/vdso32.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ SECTIONS
.got : { *(.got) } :text
.plt : { *(.plt) }

.rela.dyn : { *(.rela .rela*) }

_end = .;
__end = .;
PROVIDE(end = .);
Expand All @@ -87,7 +89,7 @@ SECTIONS
*(.branch_lt)
*(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss)
*(.got1 .glink .iplt .rela*)
*(.got1 .glink .iplt)
}
}

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/vdso/vdso64.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand All @@ -86,7 +86,7 @@ SECTIONS
*(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss)
*(.opd)
*(.glink .iplt .plt .rela*)
*(.glink .iplt .plt)
}
}

Expand Down

0 comments on commit af4d563

Please sign in to comment.