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

Mach-O AArch64 relocation addend improvements #581

Merged
merged 3 commits into from
Oct 24, 2023

Commits on Oct 24, 2023

  1. macho: fix PC relative relocation offset for AArch64

    For PC relative relocations on some architectures, the implicit addend
    does not include the offset required due to the PC being different from
    the place of the relocation.
    
    Previously we always used an offset of 4, since this is commonly required
    by x86-64. However, this is not correct for AArch64 or for some x8-64
    relocations, and probably not correct for other architectures either.
    For example, the ARM offset may vary depending on the instruction used.
    
    For now, disable this handling for all non x86 targets. This fixes AArch64.
    Support for other architectures is left as a TODO.
    philipc committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    17c4103 View commit details
    Browse the repository at this point in the history
  2. write/macho: fix ARM64_RELOC_ADDEND handling

    - fix SectionHeader::nreloc to include additional ARM64_RELOC_ADDEND relocations
    - switch order of ARM64_RELOC_ADDEND and its paired relocation
    - emit ARM64_RELOC_ADDEND for more relocation types
    philipc committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    edd17a5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    df35618 View commit details
    Browse the repository at this point in the history