-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Tracking Issue for BTF relocations (btf_relocations) #160616
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.S-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Activity
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.S-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Feature gate:
#![feature(btf_relocations)]This is a tracking issue for experimental BPF Type Format (BTF) Compile Once, Run Everywhere (CO-RE) relocation support, as proposed in rust-lang/rfcs#3966.
The feature introduces
#[btf_relocatable]for structs and unions that model external BTF types. Ordinary field projection andoffset_of!are rejected for these types because they would produce fixed offsets without preserving the field identity needed for CO-RE relocation.The feature also provides BTF-aware field metadata queries through
core::btf. These queries returnOption<usize>so programs can account for fields that do not exist in the target BTF.The current implementation supports LLVM BPF targets and requires debug info. Unsupported targets, backends, and codegen configurations produce a compile error.
Public API
Both macros expand to an expression of type
Option<usize>.Steps / History
(Remember to update the
S-tracking-*label when checking boxes.)Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩