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

Support for object crate not returning null symbol/section #6

Merged
merged 1 commit into from
May 9, 2024

Conversation

philipc
Copy link
Contributor

@philipc philipc commented May 9, 2024

The current git version of object no longer returns the null symbol or section at index 0.

For sections, check for this and add an extra section slot if needed.

For symbols, there are multiple places where we iterate over the input symbols, and adding an extra symbol every time is a bit ugly. Instead, add SymbolIdRange to recording the starting index and add methods to convert between id, vec index, and ELF index. These methods also include debug assertions to validate the values are in the correct range.

The current git version of `object` no longer returns the null symbol or
section at index 0.

For sections, check for this and add an extra section slot if needed.

For symbols, there are multiple places where we iterate over the input
symbols, and adding an extra symbol every time is a bit ugly.
Instead, add `SymbolIdRange` to recording the starting index and
add methods to convert between id, vec index, and ELF index.
These methods also include debug assertions to validate the values
are in the correct range.
@philipc
Copy link
Contributor Author

philipc commented May 9, 2024

I was trying to get back to finishing off #5, but I discovered that gimli-rs/object#679 has broken wild. Not sure how you feel about the changes in this PR. Other options would be to switch wild to using object's lower level API for sections and symbols too, or consider reverting the object change.

@davidlattimore
Copy link
Owner

Thanks for the fix! I think the SymbolIdRange abstraction worked out nicely.

BTW, if it makes it easier at any point, I'm happy to temporarily switch to using object from github rather than crates.io.

@davidlattimore davidlattimore merged commit c3ac9db into davidlattimore:main May 9, 2024
@philipc philipc deleted the object branch May 9, 2024 02:54
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