Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for relocations + fixes #572

Merged
merged 7 commits into from
Apr 13, 2023
Merged

Conversation

alessandrod
Copy link
Collaborator

@alessandrod alessandrod commented Apr 11, 2023

This PR does a few things:

  • improves maps relocations, removes MapKind and adds comments explaining the difference between the old maps/blah section, the new legacy (tm) maps section, and the BTF .maps section. (I hope ebpf never changes anything to do with maps again, or otherwise I guess we'll have to start using .maps?! next) fab31ea
  • It adds some relocation tests which fail with current main 610ecbf
  • It fixes the failing relocation cases cfd3436. This bit is more complex than it has to be, because the object crate hides away the actual BPF relocation types. I've decided that I want to remove the object crate and use a smol ad-hoc 300 lines of code ELF parser I wrote for rbpf. I started doing that and the diff got out of hand, so I'll do that separately at some point.

@netlify
Copy link

netlify bot commented Apr 11, 2023

Deploy Preview for aya-rs-docs ready!

Name Link
🔨 Latest commit 3a8380d
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/6437f2f9ea15e10008adb109
😎 Deploy Preview https://deploy-preview-572--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

In preparation of adding actual ELF relocation tests
Avoid allocations and add comments explaining how things work.
Clearly split the code between `.maps`, `maps` and data maps (bss, data,
rodata). Sprinkle comments.

Remove MapKind which was effectively only needed since we used to have
one variant - BpfSectionKind::Data - to represent all data maps. Instead
add explicit BpfSectionKind::{Data, Rodata, Bss} variants and match on
those when we initialize maps.
Fix R_BPF_64_64 text relocations in sections other than .text (for
instance .text.unlikely). Also fix misc bugs triggered by integration
tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants