Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: questions on dynamic linking on SunOS Message-ID: <2464@auspex.auspex.com> Date: 18 Sep 89 18:33:47 GMT References: <7997@medusa.cs.purdue.edu> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 27 >1. Sun4.0 OS DOES dynamically loading of libraries (option -Bdynamic). >Thus while linking the loader just remembers the path name of the libraries >and dynamically loads the needed routines DURING THE EXECUTION OF THE PROGRAM. Well, dynamically links them, anyway. The libraries are mapped into the address space of the process at program start-up time; the run-time loader is run from the C start-up code. >2. This however does not solve the application I have , which requires >dynamic loading of object files during execution and call arbitrary >functions ( decided during the execution time) from them. That is I >don't have function calls embedded in the code to exploit features >discussed in 1. Correct. 4.0 doesn't have a way for a program to call the run-time loader to get it to map a library in at run time or, given a "handle" for a mapped-in library and a string that represents the name of a function in that library, return a pointer to the function in question. I expect SunOS 4.1 and S5R4 to have calls to do that. >3. SUN4.0 OS comes with incremental loading option (-A) which allows >one to create a object file based on the symbol table of another a.out. >The resulting object file uses incremental loading to avoid loading routines >which are already resolved in symbol table of the referenced a.out. This actually comes from 4.xBSD (was it introduced there for the benefit of Franz Lisp?), so it may be available on other systems as well.