dynamic loading under SunOS 4.1

Glenn Gribble synaptx!glenn at uunet.uu.net
Tue Jun 5 03:22:47 AEST 1990


There is another way to do dynamic loading:

DESCRIPTION

This is a dynamic loader for Sun3 and Sun4.  The interface is very simple.
There are three main functions:

setArg0(const char *)  - Call with argv[0] to find main object file 
bool loadFile(const char *fileName) - Load an object file 
long value(const char *sym, int bad=-1) - Find symbol value

This loader reads the object file into memory and does the relocation on
its own.  This makes it fast and it works even if the main object file is
dynamically linked (the loaded object file can make calls into the shared
libraries).  

The advantages of this loader over SunOS 4.1 dlopen() or "ld -A":

1) Works with normal object files (does not use shared libraries)
2) Works if the main object file is dynamically linked.
3) Loaded object can have symbol dependencies into main file or previously
   loaded object files.
4) It is much faster than the "ld -A" approach.

The disadvantage:

1) It will not load every type of file since I have not found ways of
   making all relocation types in Sun object files.

Other things to note:

1) It is written in C++.
2) It is free and unsupported (although I would like to hear of bugs).

Glenn Gribble			glenn at synaptics.com	uunet!synaptx!glenn
Synaptics, Inc.			(408) 434-0110
2860 Zanker Road, Suite 105	(408) 434-9819 FAX
San Jose, CA 95134

[[Ed's Note: Source placed in archives. -bdg]]

FTP:	Hostname : titan.rice.edu (128.42.1.30)
	Directory: sun-source
	Filename : dynload.shar
	Filesize : 23435 bytes

Archive Server Address: archive-server at rice.edu
Archive Server Command: send sun-source dynload.shar



More information about the Comp.sys.sun mailing list