btf_loader: Use btf__endianness() instead of to be removed btfe member

When loading a file, via btf__parse_split() libbtf will read the header
and have the endianness made available via the btf__endianness() API,
use it.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-06-02 09:11:57 -03:00
parent 9f8ce7e113
commit 81fe7d688d
1 changed files with 2 additions and 1 deletions

View File

@ -562,7 +562,6 @@ int btf_elf__load_file(struct cus *cus, struct conf_load *conf, const char *file
cu->language = LANG_C;
cu->uses_global_strings = false;
cu->little_endian = !btfe->is_big_endian;
cu->dfops = &btf_elf__ops;
cu->priv = btfe;
btfe->priv = cu;
@ -571,6 +570,8 @@ int btf_elf__load_file(struct cus *cus, struct conf_load *conf, const char *file
if (err != 0)
goto out_free_cu;
cu->little_endian = btf__endianness(btfe->btf) == BTF_LITTLE_ENDIAN;
err = btf_elf__load_sections(btfe);
if (err != 0)
goto out_free_cu;