Skip to content

macho: handle cases where entrypoint is in an archive or dylib - #15135

Merged
kubkon merged 7 commits into
masterfrom
fix-15103
Apr 1, 2023
Merged

kubkon merged 7 commits into
masterfrom
fix-15103

Conversation

@kubkon

@kubkon kubkon commented Mar 31, 2023 •

Copy link
Copy Markdown
Member

Fixes #15103

While at it, update TAPI parser. Done in a separate commit 381dc2d

This PR:

  • allows for the entrypoint to be defined in a library (archive or dylib)
  • adds handling of -u flag in the CLI and in the MachO linker
  • tests new MachO features

@kubkon
kubkon force-pushed the fix-15103 branch 2 times, most recently from d9b91e4 to ca7e781 Compare April 1, 2023 12:21
kubkon added 6 commits April 1, 2023 14:22
Also clean up parsing of linker args - reuse `ArgsIterator`.

In MachO, ensure we add every symbol marked with `-u` as undefined
before proceeding with symbol resolution. Additionally, ensure those
symbols are never garbage collected.

MachO entry_in_dylib test: pass `-u _my_main` when linking executable
so that it is not incorrectly garbage collected by the linker.
@kubkon
kubkon merged commit ab44b45 into master Apr 1, 2023
@kubkon
kubkon deleted the fix-15103 branch April 1, 2023 20:30
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.

link: search for entry point in archives if no object file explicitly specified

1 participant