Delete format specific variants in RelocationKind#585
Merged
philipc merged 7 commits intogimli-rs:masterfrom Jan 3, 2024
Merged
Delete format specific variants in RelocationKind#585philipc merged 7 commits intogimli-rs:masterfrom
philipc merged 7 commits intogimli-rs:masterfrom
Conversation
No functionality change.
This is preparation for doing this step earlier. No functionality changes.
No functionality change.
This is preparation for removing the size field when the user specifies the flags, and also lets us do the flag calculation earlier.
This simplifies the code because we no longer need to avoid modifying the addend in the relocation. Also make the implicit addend handling clearer.
Previously we adjusted the addend based on the relocation kind. For cases where the flags are derived from the relocation kind, this should not change the behaviour. For cases where the user supplies the flags, this ensures the adjustment is consistent with the flags that are actually used (since previously the kind and flags did not need to agree). This is preparation for removing the relocation kind field when the user supplies the flags.
Replace uses of these variants with read::Relocation::flags and write::Relocation::flags. Additionally, for write::Relocation, move the kind/encoding/size fields into RelocationFlags::Generic, since these are not required when using format specific variants.
mcbegamerxx954
pushed a commit
to mcbegamerxx954/object
that referenced
this pull request
Jun 15, 2024
Delete format specific variants in RelocationKind
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.
Replace uses of these variants with
read::Relocation::flagsandwrite::Relocation::flags.Additionally, for
write::Relocation, move thekind/encoding/sizefields intoRelocationFlags::Generic, since these are not required when using format specific variants.Closes #214