questions on dynamic linking on SunOS

Guy Harris guy at auspex.auspex.com
Tue Sep 19 04:33:47 AEST 1989


>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.



More information about the Comp.unix.wizards mailing list