Closed pablogsal closed 2 years ago
Thanks for reporting the issue.
As far as I checked, the load commands are in programs since macOS 12 though they may be in header files since macOS 10.15. Tests passes on macOS 11 with various compiler/linker flags but not on macOS 12 even with default flags.
I fixed plthook to support LC_DYLD_CHAINED_FIXUPS
on macOS (intel).
I hope it works also on macOS (arm).
Thanks a lot for the fantastic work! I will give it a try in amd64
Reopened because it doesn't work for binary compiled for macOS 12 Monterey (ARM).
make test
fails on macOS 12 Monterey hosted on bitrise M1 stacks.
When test files are compiled for macOS 11 Big Sur by setting MACOSX_DEPLOYMENT_TARGET=11
, make test
passes.
There are two new load commands added in 10.15 / iOS 13 (http://newosxbook.com/articles/13-10.15.html and can be seen in /Applications.Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h:324
define LC_DYLD_EXPORTS_TRIE (0x33 | LC_REQ_DYLD) / used with linkedit_data_command, payload is trie /
define LC_DYLD_CHAINED_FIXUPS (0x34 | LC_REQ_DYLD) / used with linkedit_data_command /
Without handling these linker commands, the functionality of the library is restricted to macOS < 10.15