Apply relocations manually in DWARF parsing. #7487
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After some DMs with @negasora, this should hopefully address #7480.
The problem is that we're not applying relocations. So, the data we're giving to
gimliis incorrect. We need to apply those relocations.Unfortunately, since we're in a raw view, that's not trivial to do. An earlier version of this code tried to apply the relocations ourselves, but it turns out we can't even get the correct relocation ranges out of the BV at this point.
We had the idea of taking on
objectas a dependency to tell us where the relocations are and help us apply them manually before we hand stuff off togimli. This feels bad, though, so I tried to walk Claude Code through the problem in the hopes that it would help us solve it without needingobject.After about 30 minutes, it decided to give up and take the dependency itself despite my having told it not to. So, I've thrown in the towel, and here's a PR with a cleaned-up version of the solution.
Feel free to reject and do something else if you can, but this code does work for the crashing sample. I have it going through CI right now, so we'll see if it survives other platforms and unit tests, too.