Search code examples
linkermach-o

Patch links in a Mach-O file?


I have a Mach-O binary which is very old and linked to a bunch of old frameworks than no longer exist or incompatible.

My aim is to abstract the components from these frameworks without replacing my existing frameworks. For that I want to change the built in frameworks paths so they point to my abstracted frameworks.

How can I modify the paths of linked frameworks in a Mach-O file?


Solution

  • Mac OS X has a program called install_name_tool for this task.

    The -change option is what you are probably looking for:

    install_name_tool -change oldLibName yourNewImplmentation machOFile