Commit cf579164 authored by Tony Ambardar's avatar Tony Ambardar Committed by Alexei Starovoitov
Browse files

libbpf: Support BTF.ext loading and output in either endianness



Support for handling BTF data of either endianness was added in [1], but
did not include BTF.ext data for lack of use cases. Later, support for
static linking [2] provided a use case, but this feature and later ones
were restricted to native-endian usage.

Add support for BTF.ext handling in either endianness. Convert BTF.ext data
to native endianness when read into memory for further processing, and
support raw data access that restores the original byte-order for output.
Add internal header functions for byte-swapping func, line, and core info
records.

Add new API functions btf_ext__endianness() and btf_ext__set_endianness()
for query and setting byte-order, as already exist for BTF data.

[1] 3289959b ("libbpf: Support BTF loading and raw data output in both endianness")
[2] 8fd27bf6 ("libbpf: Add BPF static linker BTF and BTF.ext support")

Signed-off-by: default avatarTony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/133407ab20e0dd5c07cab2a6fa7879dee1ffa4bc.1726475448.git.tony.ambardar@gmail.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent f896b4a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment