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

macho: move load command wrappers and parsing utils to std.macho #10310

Merged
merged 2 commits into from Dec 10, 2021

Conversation

kubkon
Copy link
Member

@kubkon kubkon commented Dec 10, 2021

  • move additional helpers such as link.MachO.commands.sectionName to std.macho.section_64.sectName, etc.
  • move load command wrappers LoadCommand, etc., and parsing utils to std.macho
  • remove link.MachO.commands module as it's now obselete
  • update enum tags in std.macho.LoadCommand union

This is the first step in trying to unify MachO parsing utilities between the linker and stack trace printing. However, since the former currently doesn't take advantage of mmap while the latter does, they cannot yet be simplified, but as this should provide a common platform for such changes. I also intend to reuse the MachO parsing utils in the upcoming zig ld test harness that I'm currently working on.

Helper functions such as `commands.sectionName`, etc. should really
belong in `std.macho.section_64` extern struct.
This way we will finally be able to share common parsing logic
between different Zig components and 3rd party packages.
@kubkon kubkon merged commit 75f3e7a into master Dec 10, 2021
@kubkon kubkon deleted the macho-common-functions branch December 10, 2021 20:55
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.

None yet

1 participant