Loading .so files from memory

Possible duplicate:
dlopen from memory?

I have seen this for Windows DLLs that are loaded from the memory buffer, but I cannot find it anywhere on Linux, and the "ld" source code is the most complex code I have ever seen. So:

Is there any example of loading .so files from memory? Even simple, which can I finish? I just don't know where to start, although I read most of the ELF specifications that are still mysterious to me.

+5
source share
3 answers

: ld . dlopen dlsym, libc. , : ld-linux.so( ; ldd /bin/ls, , ).

ELF , ; ABI ( 32- 64- Linux, .)

( , SO), X11: , , , - .

+8

" .so "?

*.so, . dlopen .

, ? ? ? ( ELF ELF ?)

, ELF *.so, (.. ) - ( , tmpfs, ). dlopen, .

ELF .so, , . , (, LLVM, GCCJIT, libjit, GNU, LuaJit....).

, , mmap mprotect (, ).

0

You need the dlopen () family of functions (on GNU / Linux they are defined in /usr/include/dlfcn.h).

As an example, consider how PHP makes modules .

-1
source

All Articles