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:
parent
9f8ce7e113
commit
81fe7d688d
|
@ -562,7 +562,6 @@ int btf_elf__load_file(struct cus *cus, struct conf_load *conf, const char *file
|
||||||
|
|
||||||
cu->language = LANG_C;
|
cu->language = LANG_C;
|
||||||
cu->uses_global_strings = false;
|
cu->uses_global_strings = false;
|
||||||
cu->little_endian = !btfe->is_big_endian;
|
|
||||||
cu->dfops = &btf_elf__ops;
|
cu->dfops = &btf_elf__ops;
|
||||||
cu->priv = btfe;
|
cu->priv = btfe;
|
||||||
btfe->priv = cu;
|
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)
|
if (err != 0)
|
||||||
goto out_free_cu;
|
goto out_free_cu;
|
||||||
|
|
||||||
|
cu->little_endian = btf__endianness(btfe->btf) == BTF_LITTLE_ENDIAN;
|
||||||
|
|
||||||
err = btf_elf__load_sections(btfe);
|
err = btf_elf__load_sections(btfe);
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
goto out_free_cu;
|
goto out_free_cu;
|
||||||
|
|
Loading…
Reference in New Issue