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: Add the ability to parse the chained fixups #598

Open
PaulDance opened this issue Nov 20, 2023 · 1 comment
Open

Mach-O: Add the ability to parse the chained fixups #598

PaulDance opened this issue Nov 20, 2023 · 1 comment

Comments

@PaulDance
Copy link

Mach-O objects can contain a data structure pointed to by the LC_DYLD_CHAINED_FIXUPS linkedit-type load command that, uh... does things. To be honest, I really don't know what its purpose truly is, but it seems to describe optional modifications to apply to import symbols upon loading.

In any case, having it supported in object would be nice as there are currently no implementation of it publicly available, at least I haven't found any. The start of it would be porting the fixup-chains.h definitions. Then, the parsing algorithm would need to be implemented as well if it is desirable to have it.

A few questions about the contribution then:

  • Does this even have its place in object?
  • What would go in macho vs. read::macho? There is a bunch of struct definitions similar to the rest of macho and also some non-trivial parsing logic.
  • Would it be desirable to add it to a higher-level API?
  • If so, should it be added directly onto MachOFile or to the Object trait and its implementation of it? Having it outside of the trait makes more sense to me because it would not be behavior common to all formats, but I'm just checking anyways.
@philipc
Copy link
Contributor

philipc commented Nov 21, 2023

LLVM appears to have an implementation in lib/Object/MachOObjectFile.cpp.

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

No branches or pull requests

2 participants