Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!rice!sun-spots-request From: chuck@morgan.com (Chuck Ocheret) Newsgroups: comp.sys.sun Subject: Re: dynamic loading under SunOS 4.1 Keywords: SunOS Message-ID: <8316@brazos.Rice.edu> Date: 30 May 90 14:44:49 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 23 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n188 X-Sun-Spots-Digest: Volume 9, Issue 188, message 5 > 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