[PATCH] D91489: BPF: make __builtin_btf_type_id() return 64bit int

Andrii Nakryiko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 15 13:02:48 PST 2020


anakryiko added inline comments.


================
Comment at: llvm/lib/Target/BPF/BTFDebug.cpp:1230
+            Reloc == BPFCoreSharedInfo::BTF_TYPE_ID_REMOTE)
           OutMI.setOpcode(BPF::LD_imm64);
         else
----------------
yonghong-song wrote:
> ast wrote:
> > libbpf would need to support both (ld_imm64 and mov32), right?
> all selftests passed. I suspect libbpf already supports both ld_imm64 and mov32...
there is no need to make BTF_TYPE_ID_LOCAL to return u64, but if it helps uniformity, then why not.

libbpf does support ldimm64 in general, but I'll need to extend this specifically for BTF_TYPE_ID_REMOTE to record module BTF ID in upper 32 bits. For now it will be just zeroes, which works fine.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91489/new/

https://reviews.llvm.org/D91489



More information about the cfe-commits mailing list