gimli-rs / object

A unified interface for reading and writing object file formats
https://docs.rs/object/
Apache License 2.0
658 stars 149 forks source link

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

Open PaulDance opened 10 months ago

PaulDance commented 10 months ago

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:

philipc commented 10 months ago

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