libbpf: Record extern sym relocation first
authorMartin KaFai Lau <kafai@fb.com>
Thu, 25 Mar 2021 01:52:27 +0000 (18:52 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 27 Mar 2021 03:41:51 +0000 (20:41 -0700)
commitaa0b8d43e9537d371cbd3f272d3403f2b15201af
treecce5b4309f5669bf16a6cf4be613d44a535ab615
parent0c091e5c2d37696589a3e0131a809b5499899995
libbpf: Record extern sym relocation first

This patch records the extern sym relocs first before recording
subprog relocs.  The later patch will have relocs for extern
kernel function call which is also using BPF_JMP | BPF_CALL.
It will be easier to handle the extern symbols first in
the later patch.

is_call_insn() helper is added.  The existing is_ldimm64() helper
is renamed to is_ldimm64_insn() for consistency.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210325015227.1548623-1-kafai@fb.com
tools/lib/bpf/libbpf.c