Unix Programming - Re: Possible to do the equivalent of dlopen with an executable

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2006 > Re: Possible to do the equivalent of dlopen with an executable





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Possible to do the equivalent of dlopen with an executable
Paul Pluzhnikov

2006-07-20, 1:23 pm

gazelle@xmission.xmission.com (Kenny McCormack) writes:

> Note, incidentally, given that other posters have mentioned Windows and
> made comparisons thereto, that the actual origin of this problem is:
> I have an application which ships in both Windows and Solaris flavors
> and I am able to do this thing in the Windows version (it is supported
> there).


It is probably time to re-think your design.

> And, therefore, I'd like to be able to do the same in the Solaris version.


It is possible to do this on Solaris, but it will require so much
effort that you are unlikely to succeed on that path. And the effort
would have to be repeated on every other UNIX you'll want to port to.

All you have to do is "pretend" that your executable is the dynamic
linker (/lib/ld.so.1) and load (mmap) the executable yourself. Then
load all its direct dependencies, relocate, arrange for lazy symbol
resolution, etc. etc.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com