Page 1 of 1

dlopen: load dylib from memory rather then file.

PostPosted: Wed Jun 07, 2017 10:28 am
by adam81

I'd like to practice loading dylib to my executable, which already reside in memory rather then in file.
I'm using LC_SYMTAB and LC_LINKEDIT to locate the symbols and call them successfully, unless they contain lazy symbols (like printf).

To overcome this, I'd like to avoid dirty symbols when compiling the dylib (that will be copied to memory later on..).
I got some ideas after reading this article
so I've tried to compile the dylib using
Code: Select all
flag but the lazy symbols remained.

Is there any way to get rid of all symbols that requires additional work for resolving, after the library was mmap'ed ? or any other way to approach this issue (like try and resolve the symbols myself using dyld hidden API)