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

Delete format specific variants in RelocationKind #585

Merged
merged 7 commits into from
Jan 3, 2024

Conversation

philipc
Copy link
Contributor

@philipc philipc commented Oct 26, 2023

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.

Closes #214

This is preparation for doing this step earlier.
No functionality changes.
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.
@philipc philipc merged commit e719bd6 into gimli-rs:master Jan 3, 2024
12 checks passed
@philipc philipc deleted the reloc branch January 3, 2024 07:20
mcbegamerxx954 pushed a commit to mcbegamerxx954/object that referenced this pull request Jun 15, 2024
Delete format specific variants in RelocationKind
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.

write: redesign relocation kinds
1 participant