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

Commits on Dec 24, 2023

  1. write/object: split fixup_relocation into two steps

    No functionality change.
    philipc committed Dec 24, 2023
    Configuration menu
    Copy the full SHA
    7df6b5c View commit details
    Browse the repository at this point in the history
  2. write: move relocation flag calculation into separate functions

    This is preparation for doing this step earlier.
    No functionality changes.
    philipc committed Dec 24, 2023
    Configuration menu
    Copy the full SHA
    7d5c8f4 View commit details
    Browse the repository at this point in the history
  3. write: calculate relocation flags when adding relocations

    No functionality change.
    philipc committed Dec 24, 2023
    Configuration menu
    Copy the full SHA
    eec1859 View commit details
    Browse the repository at this point in the history
  4. write/object: derive addend size from relocation flags

    This is preparation for removing the size field when the user
    specifies the flags, and also lets us do the flag calculation
    earlier.
    philipc committed Dec 24, 2023
    Configuration menu
    Copy the full SHA
    429b5f2 View commit details
    Browse the repository at this point in the history
  5. write/object: calculate relocation flags before adjusting addend

    This simplifies the code because we no longer need to avoid
    modifying the addend in the relocation.
    
    Also make the implicit addend handling clearer.
    philipc committed Dec 24, 2023
    Configuration menu
    Copy the full SHA
    d84dbcf View commit details
    Browse the repository at this point in the history
  6. write/object: adjust addend using relocation flags

    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.
    philipc committed Dec 24, 2023
    Configuration menu
    Copy the full SHA
    6dea0d5 View commit details
    Browse the repository at this point in the history
  7. Delete format specific variants in RelocationKind

    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 committed Dec 24, 2023
    Configuration menu
    Copy the full SHA
    eb58357 View commit details
    Browse the repository at this point in the history