BPF Archive on lore.kernel.org
 help / color / Atom feed
From: Tony Ambardar <tony.ambardar@gmail.com>
To: bpf@vger.kernel.org, dwarves@vger.kernel.org
Subject: Problem with endianess of pahole BTF output for vmlinux
Date: Sat, 5 Sep 2020 21:16:23 -0700
Message-ID: <CAPGftE8ipAacAnm9xMHFabXCL-XrCXGmOsX-Nsjvz9wnh3Zx-w@mail.gmail.com> (raw)


I'm using GCC 8.4.0, binutils 2.34 and pahole 1.17, compiling on an
Ubuntu/x86_64 host and targeting both little- and big-endian mips
running on malta/qemu. When cross-compiling Linux 5.4.x LTS and
testing bpftool/BTF functionality on the target, I encounter errors on
big-endian targets:

> root@OpenWrt:/# bpftool btf dump file /sys/kernel/btf/vmlinux
> libbpf: failed to get EHDR from /sys/kernel/btf/vmlinux
> Error: failed to load BTF from /sys/kernel/btf/vmlinux: No error information

After investigating, the problem appears to be that "pahole -J"
running on the x86_64 little-endian host will always generate raw BTF
of native endianness (based on BTF magic), which causes the error
above on big-endian targets.

Is this expected? Is DEBUG_INFO_BTF supported in general when
cross-compiling? How does one generate BTF encoded for the target
endianness with pahole?

Thanks for any feedback or suggestions,

             reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06  4:16 Tony Ambardar [this message]
2020-09-07 15:59 ` Ilya Leoshkevich
2020-09-08 20:18   ` Andrii Nakryiko
2020-09-09  9:02     ` Ilya Leoshkevich
2020-09-09 14:27       ` Arnaldo Carvalho de Melo
2020-09-19  7:58         ` Tony Ambardar
2020-09-21 18:19           ` Andrii Nakryiko
2020-09-28 20:18             ` Andrii Nakryiko
2020-09-28 20:27               ` Luka Perkov
2020-09-29  3:41               ` Tony Ambardar
2020-09-29  4:15                 ` Andrii Nakryiko
2020-09-29  6:48                   ` Tony Ambardar
2020-09-29 17:36                     ` Juraj Vijtiuk
2020-09-29 17:57                     ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPGftE8ipAacAnm9xMHFabXCL-XrCXGmOsX-Nsjvz9wnh3Zx-w@mail.gmail.com \
    --to=tony.ambardar@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
	public-inbox-index bpf

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git