]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc: Do not consider weak unresolved symbol relocations as bad
authorAlexandre Ghiti <alex@ghiti.fr>
Sat, 18 Jan 2020 17:03:35 +0000 (12:03 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:38:46 +0000 (08:38 +0100)
commit89a2281b1a5094bc05263cc0e3090e146cf57b21
tree8a2cb6c7225fb27c1412e5df4ec5d93d8ecf1b28
parent9d7222c9f95c7c3852f4af9df809404e85ee605c
powerpc: Do not consider weak unresolved symbol relocations as bad

[ Upstream commit 43e76cd368fbb67e767da5363ffeaa3989993c8c ]

Commit 8580ac9404f6 ("bpf: Process in-kernel BTF") introduced two weak
symbols that may be unresolved at link time which result in an absolute
relocation to 0. relocs_check.sh emits the following warning:

"WARNING: 2 bad relocations
c000000001a41478 R_PPC64_ADDR64    _binary__btf_vmlinux_bin_start
c000000001a41480 R_PPC64_ADDR64    _binary__btf_vmlinux_bin_end"

whereas those relocations are legitimate even for a relocatable kernel
compiled with -pie option.

relocs_check.sh already excluded some weak unresolved symbols explicitly:
remove those hardcoded symbols and add some logic that parses the symbols
using nm, retrieves all the weak unresolved symbols and excludes those from
the list of the potential bad relocations.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200118170335.21440-1-alex@ghiti.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/Makefile.postlink
arch/powerpc/tools/relocs_check.sh