[comp.sys.sun] dynamic file loading

bagchi@eecs.umich.edu (Ranjan Bagchi) (01/03/91)

This is concerning SunOS 4.1 on a Sparc.  I've been working with the
executable file structure as outlined in a.out (5), and have questions
regarding the dynamic loading which seem to be omited from the man page.

Essentially, what happens?  When the loading is static, it is easy to
find, for instance (and what my main interest really is), the function
pointers to all the functions called within the program. But when the
loading is dynamic, I can find nothing.  Here's the specific breakdown of
questions:

1.  The way I've had it explained to me is that upon execution of of a
dynamic a.out file, the loader finds names of the external symbols, and
then goes somewhere (libraries?) to find the matching symbols and links up
the pointers.  Is this correct?

2.  If so, where does the loader go for this information?

3.  How would I go about pretending to be the loader, and get pointers to
information not in the a.out file?

Ranjan Bagchi - At Large.  Well Kinda.
bagchi@[eecs
        caen,
	math.lsa].umich.edu]

oj@saber.com (01/07/91)

|This is concerning SunOS 4.1 on a Sparc.  I've been working with the
|executable file structure as outlined in a.out (5), and have questions
|regarding the dynamic loading which seem to be omited from the man page.

|Essentially, what happens? 

Here's a list of relevant documentation.  

ld(1)  (the WHOOOOLE thing)
ldd(1)
ldconfig(8)

dlopen(3x)
a.out(5)
link(5)

Also, "Programming Utilities and Libraries," Ch 1.

AT&T's Sparc ABI Supplement (one of the blue Prentice Hall books) has a
chapter (no. 5) on program loading.

It's hairy.  Good luck.

Ollie Jones             Saber Software, Inc.       oj@saber.com
Saber-C Project Leader  185 Alewife Brook Parkway  uunet!saber.com!oj
+1(617)876-7636         Cambridge, MA 02138-9887   fax +1(617)868-9205