macosdylibmach-o

Editable / patchable resources within dylib?


Is there any way to embed resources (e.g. strings / images) within a Mach-O dylib such that they are editable post-build? Similar to resources in PE files.

I know I should be using Bundles instead, but humour me ;-)


Solution

  • You could use the -sectcreate linker flag to embed some data into a binary. See this Embedding Data blog post for a complete explanation of the procedure.