External Publication
Visit Post

[Pre-RFC] BTF relocations

Rust Internals [Unofficial] April 10, 2026
Source

A few questions:

  • Can a relocation affect whether two fields overlap (e.g. if a struct changes to a union)?
  • Can a relocation change an array index?
  • Can a relocation affect the number of pointer dereferences necessary to access a field?
  • Is it ever possible to construct one of these structs? Or does the potential for additional fields Rust doesn't know about mean construction must be forbidden?
  • Do we need an analogue of #[link_name] for struct and field names?
  • What is the failure mode like? If you make a mistake or run on an unsupported kernel version, and the relocations aren't sufficient to make offets or types line up, is the verifier guaranteed to reject the program?
  • Is there any connection to/similarity with Swift stable ABI?

Discussion in the ATmosphere

Loading comments...