This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Loading Shared Object from memory


Hi,

I want to load a shared object from memory out of another ELF binary
(app or SO). For this the SO is stored e.g. in a byte array of the
base ELF binary. The byte array contains the SO as it is stored in a
file on disk. During runtime I want to load this SO WITHOUT storing
it temporary on disk! If I would do this I can make this with
dlopen(), etc.

Another idea is that I can map the segments of the SO into memory
and do the work of dlopen() by my own. But this seems to be a lot of
work and is in my opinion very error prone. 

Now the question is: Is there a way to run the already loaded
ld-linux.so twice over the new mapped SO? The entry point of the
loaded ld-linux.so I can get with dlopen() + dladdr(). But if I
currently do this out the base ELF binary a SegFault is occurring.

Or is there an easier way to do this at all?

Thank is advance,
Alex

  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]