Fix data flow analysis for multiple text sections#220
Merged
encounter merged 9 commits intoencounter:mainfrom Jul 17, 2025
Merged
Fix data flow analysis for multiple text sections#220encounter merged 9 commits intoencounter:mainfrom
encounter merged 9 commits intoencounter:mainfrom
Conversation
* Data flow analysis results were only keyed by the symbol (function) address. That doen't work if there are multiple text sections, the result from the first function in one section will stomp the result from the first function in another because both have address zero. * Remove the ambiguity by keying off of the section address as well.
Contributor
Author
|
PR does build, not sure why clippy is failing for stuff I didn't touch. |
encounter
reviewed
Jul 7, 2025
encounter
reviewed
Jul 7, 2025
objdiff-core/src/obj/mod.rs
Outdated
| symbol: &Symbol, | ||
| result: Box<dyn FlowAnalysisResult>, | ||
| ) { | ||
| let key = symbol.section.unwrap_or_default() as u64 + symbol.address; |
Owner
There was a problem hiding this comment.
This key seems like it could easily overlap, the section indices are small numbers
Contributor
Author
There was a problem hiding this comment.
Oops, mixed up which was the section address vs section number.
This thing gets called a lot so I want a cheap solution, so I just multiplied by a GB. If there's a single section bigger than a GB other things will break before this.
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Data flow analysis results were only keyed by the symbol (function) address. That doesn't work if there are multiple text sections. The result from the first function in one text section will stomp the result from the first function in another because both have address zero.
Remove the ambiguity by keying off of the section address as well.