]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libbpf: Support linking bpf objects of either endianness
authorTony Ambardar <tony.ambardar@gmail.com>
Mon, 16 Sep 2024 08:37:45 +0000 (01:37 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Oct 2024 00:47:36 +0000 (17:47 -0700)
commit0aed726cf6f97bfe11de693781504787857894b7
tree29fddc095a2d52eae1c523763b7952a82b704b1e
parentbcc60abd67c7741a065480df4875534f62f758b1
libbpf: Support linking bpf objects of either endianness

Allow static linking object files of either endianness, checking that input
files have consistent byte-order, and setting output endianness from input.

Linking requires in-memory processing of programs, relocations, sections,
etc. in native endianness, and output conversion to target byte-order. This
is enabled by built-in ELF translation and recent BTF/BTF.ext endianness
functions. Further add local functions for swapping byte-order of sections
containing BPF insns.

Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/b47ca686d02664843fc99b96262fe3259650bc43.1726475448.git.tony.ambardar@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/linker.c