Do not duplicate relocation data#95
Open
pekangas wants to merge 1 commit into
Open
Conversation
Skip relocation data while processing segments since it will be added separately at the end of the file. Note that this logic skips entire segments if they contain nothing but relocation data so may break if a segment contains both relocations an other sections (but is that possible?) Also handle .rela relocation sections
bradjc
reviewed
Jun 20, 2025
| if reloc_only { | ||
| if verbose { | ||
| println!(" Skipping segment since it only contains relocs"); | ||
| } |
Contributor
There was a problem hiding this comment.
Can we just put a continue here (consistent with the checks above around line 629?
| println!(" Skipping segment since it only contains relocs"); | ||
| } | ||
| } else { | ||
| // Handle padding now that we know we want something from this |
Contributor
There was a problem hiding this comment.
Can we just move the entire padding check from above here? I'd like to keep the utility of the option of last_segment_address_end and not have padding == 0 mean both no padding and there can't be padding because this is the first segment.
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.
Skip relocation data while processing segments since it will be added separately at the end of the file. Note that this logic skips entire segments if they contain nothing but relocation data so may break if a segment contains both relocations an other sections (but is that possible?)
Also handle .rela relocation sections
This fixes #94 at least for our use cases..