dynamic loading under SunOS 4.1
Chuck Ocheret
chuck at morgan.com
Thu May 31 00:44:49 AEST 1990
> From: uunet!tapir.Caltech.EDU!edelsohn (David Edelsohn)
> SunOS 4.1 is suppose to have routines such as dlopen() which should
> provide runtime dynamic linking without /bin/ld -A on static programs. I
> have not seen the details yet and I am interested in finding out. The game
> should be to "cc -pic" the subroutines and then map them in with dlopen().
> This should provide user-mode access to the kernel dynamic linking/loading
> facilities which previously required the routine to be in a shared library
> known to the system prior to running the executable image.
> David
The thing missing from dlopen() is that it does not resolve symbols in my
.o (pic or not) file (as far as I can find in the manuals). If I have a
call to printf() in a .o file which I want to dynamically load in after my
process is running, how does printf()'s entry point get resolved with
SUN's shared libraries? Must I manually look through the .o symbol table
and attempt to find the modules in the various shared libraries? What
order do I use to search the libraries? On the man page for dlopen(3),
there is a mention of a -ldl option to ld (I assume this means there is a
libdl.a) which, I suspect, provide routines for accomplishing such binding
(init() and fini()). However, I cannot find any specific mention of them
anywhere else in SUN's documentation, including the Global Index.
~chuck
More information about the Comp.sys.sun
mailing list