[alt.sys.sun] Dynamic loading with shared libraries

glenn@synaptx.Synaptics.Com (Glenn Gribble) (02/26/90)

I have written a dynamic loader that works with shared libraries
(although in a not-so-nice way).  Here is the interface:

  void setArg0(const char *arg0);	// Call this with argv[0]
  bool loadFile(const char *objFile);	// Call this to load a file

This dynamic loader deals with the relocation information itself, so
it is very fast and not 100% reliable.  We use it to load modules into
our simulation enviroment.  It loads the object file, and then calls
the constructors found in that file which links the modules into the
simulation dictionary.

Times on a 3/280 (all times real time, no load on system)
  Link time for simulation enviroment	70 sec
	750K text, 4 Meg symbols (that is what -g does)
  Time to initialize dynamic loader	 4 sec
  Time to load a 90K obect file		 1 sec
	15K text, rest is symbols
  Time to re-load the same obect file	 .5 sec (the symbols get cached)

I say it is not 100% reliable because I have only been using it for
a week and there are some things that I do not handle.  Also, the way
I locate the shared libraries is by looking around in memory from
about 0x0E800000 to 0x0F000000.

If anybody would like a copy, let me know.  The source is about 800
lines of C++.

-- 
Glenn Gribble	 	glenn@synaptics.com 	uunet!synaptx!glenn