]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
libbpf: Fix output .symtab byte-order during linking
authorTony Ambardar <tony.ambardar@gmail.com>
Mon, 16 Sep 2024 08:37:42 +0000 (01:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:53 +0000 (19:50 +0100)
commit4e0e9e7af5f75e3a5543c859b24516201b3b60d7
tree3d8051c719e408173fee1876fcb386fe461876ea
parent441bbc0cf7fb9b83815530e88642a29b9fd3a662
libbpf: Fix output .symtab byte-order during linking

[ Upstream commit f896b4a5399e97af0b451fcf04754ed316935674 ]

Object linking output data uses the default ELF_T_BYTE type for '.symtab'
section data, which disables any libelf-based translation. Explicitly set
the ELF_T_SYM type for output to restore libelf's byte-order conversion,
noting that input '.symtab' data is already correctly translated.

Fixes: faf6ed321cf6 ("libbpf: Add BPF static linker APIs")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/87868bfeccf3f51aec61260073f8778e9077050a.1726475448.git.tony.ambardar@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/lib/bpf/linker.c