[all-commits] [llvm/llvm-project] 898764: [BPF] Sort BTF struct members by offset (#205396)

Tamir Duberstein via All-commits all-commits at lists.llvm.org
Thu Jun 25 10:20:33 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8987645d1d42147340367f6752cac563bf2c64be
      https://github.com/llvm/llvm-project/commit/8987645d1d42147340367f6752cac563bf2c64be
  Author: Tamir Duberstein <tamird at gmail.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
    M llvm/lib/Target/BPF/BPFCORE.h
    M llvm/lib/Target/BPF/BTFDebug.cpp
    M llvm/lib/Target/BPF/BTFDebug.h
    A llvm/test/CodeGen/BPF/BTF/struct-member-order.ll
    A llvm/test/CodeGen/BPF/CORE/struct-member-order.ll

  Log Message:
  -----------
  [BPF] Sort BTF struct members by offset (#205396)

Sort BTF structure elements by their debug offsets. Prevent
source-ordered Rust debug metadata from producing descending member
offsets after rustc chooses a different physical layout, because the
kernel rejects such BTF.

Use the sorted order for member emission, declaration-tag component
indexes, and CO-RE access strings. Keep physical offset calculations on
the original debug indexes so changing BTF order does not change
generated code.

Eliminate the need for the bpf-linker metadata rewrite by enforcing the
ordering in the LLVM BPF backend:

https://github.com/aya-rs/bpf-linker/commit/1007ec7fed03562eb7d08f3e7521094a7e698b95



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list