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

write/macho: ensure Mach-O subsections are not zero size #676

Merged
merged 1 commit into from
May 4, 2024

Commits on May 4, 2024

  1. write/macho: ensure Mach-O subsections are not zero size

    For Mach-O, `add_symbol_data` now ensures that the symbol size
    is at least 1 when subsections via symbols are enabled.
    This change was made to support linking with ld-prime. It is also
    unclear how this previously managed to work with ld64.
    
    `write::Object::add_subsection` no longer enables subsections
    via symbols for Mach-O. Use `set_subsections_via_symbols` instead.
    This change was made because Mach-O subsections are all or nothing,
    so this decision must be made before any symbols are added.
    
    `write::Object::add_subsection` no longer adds data to the subsection.
    This change was made because it was done with `append_section_data`,
    but this is often not the correct way to add data to the subsection.
    Usually `add_symbol_data` is a better choice.
    philipc committed May 4, 2024
    Configuration menu
    Copy the full SHA
    6b4fc60 View commit details
    Browse the repository at this point in the history