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

Fix parsing large-offset structs, ID resolution when parent set. #1

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

FelixMcFelix
Copy link
Contributor

@FelixMcFelix FelixMcFelix commented Aug 7, 2024

This PR contains the bare-minimum changes needed to parse an ELF object such as /system/object/dld/object -- this has large types (needing correct large offset handling behaviour), is a child of genuinx (so has different ID resolution semantics), and has a lot of types that we don't fully support here yet but which we were skipping past incorrectly.

This functionally gets us to the point where we can parse a child CTF section to look at field offsets and understand, e.g., 'is this field a pointer, and what is its offset?'. Resolving parent types (and generating structs for child CTFs) would probably need a lot of extra thought, however. In addition, this PR splits the project into lib.rs so that we can use this as a dependency in e.g. opte-ioctl. oxidecomputer/opte#504, for instance, uses this to verify we're using the right offsets for some internal structs at load time. The only caveat is that we should probably make this repo public in that case.

This PR contains the bare-minimum changes needed to parse an ELF object
such as `/system/object/dld/object` -- this has large types (needing
correct large offset handling behaviour), is a child of `genuinx` (so
ahs different ID resolution semantics), and has a lot of types that we
don't fully support here yet but were skipping past incorrectly.

This functionally gets us to the point where we can parse a child CTF
section to look at field offsets and understand, e.g., 'is this field a
pointer?'. Resolving parent types would probably need a lot of thought.
@FelixMcFelix FelixMcFelix self-assigned this Aug 7, 2024
@FelixMcFelix FelixMcFelix marked this pull request as ready for review August 7, 2024 10:39
Copy link
Collaborator

@rcgoodfellow rcgoodfellow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@FelixMcFelix FelixMcFelix merged commit 445a849 into main Aug 7, 2024
2 checks passed
@FelixMcFelix FelixMcFelix deleted the mostly-parse-dld branch August 7, 2024 20:42
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