Description
Describe the bug
The external linking of any dylibs that are exported by libsystem.b.dylib is broken. Several mac dylibs import libsystem.b.dylib to provide libc and other functionality.
libSystem.B.dylib actually doesn't implement any of the functionality, rather...
Yet, libSystem itself relies on several libraries internal to it — which are found in /usr/lib/system. It imports these libraries, and then re-exports their public symbols as if they are its own.
If I wanted to externally link _copyfile in my binary...
It will directly link to libsystem.b.dylib and error saying that it can't find copyfile...
It actually needs to link through to /usr/lib/system/libcopyfile.dylib...
I know I can manually create an external link to make copyfile work, but then all the other rexported symbols would try to resolve in libcopyfile.dylib.
Expected behavior
Would it be possible to properly handle the external LC_REEXPORT_DYLIB case in libsystem.b.dylib?
Screenshots
If applicable, add screenshots to help explain your problem.
Attachments
If applicable, please attach any files that caused problems or log files generated by the software.
Environment (please complete the following information):
- OS: macOS 14
- Java Version: 21
- Ghidra Version: 11.3
- Ghidra Origin: official GitHub distro
Activity