[comp.lang.c++] dynamic linking

vaughan@puma.cad.mcc.com (Paul Vaughan) (08/19/89)

I have some questions about dynamic linking and c++
	Who is doing it?
	What are you using to do it?
	What are you using it for?
	What are the properties of your technique?

Example:
	We're trying to use dynamic linking to enable users to add new
classes (derived from old classes) into our application at runtime.
At the moment we're using a program that uses a fixed symbol table
initialized in source code and compiled in with the running object
code to link symbols in the new code to those in the old code.  It
actually loads the new code (without using ld) and returns the address
of the first function in the newly loaded file.  It doesn't do
anything about binding symbol references in the running code to
definitions in the new code.  At the moment, I arrange the new code
files so that the first function is a constructor for a class object,
use it to create new objects, and work with them via virtual
functions.  It doesn't add the symbols in the new code into the symbol
table, so (for instance) we can't let users derive new classes from
their dynamically loaded classes, or use functions that they
dynamically loaded.  Unfortunately, I can't post the code that does
this, but I don't think anybody would want it anyway.  It's not very
satisfactory.
	Has anybody got a better solution, preferably using the
standard loader?
	When will dynamic linking be fully supported by FSF (or ATT, or . . .)?

If I get any interest, I'll post a summary to the net.


 Paul Vaughan, MCC CAD Program | ARPA: vaughan@mcc.com | Phone: [512] 338-3639
 Box 200195, Austin, TX 78720  | UUCP: ...!cs.utexas.edu!milano!cadillac!vaughan

aed@netcom.COM (Andrew Davidson) (03/15/91)

Hi
I have been having some trouble with dynamic linking and loading.

1) I am using Wilson Ho's dld-3.2.1
        sunos 4.1.1  on a sparc  station 1+
        g++-1.37.0

I can get dld to correctly link and load c object files in to my c++
application, but I can not get dld to work with c++ object files.
dld_get_func
fails. Could this because c++ mangels names? Is there anyway to figure
out what
the name of the function in the object file is?

2) has anyone tried dynamic linking using the dlopen() functions
provided in
dlfcn.h. I looked at the header file and noticed that the prototype is
in the
K&R style not ANSI style.

Thanks in advance
Andy

-- 
-----------------------------------------------------------------
                  "bede-bede-bede Thats all Folks"
				Porky Pig
Andy Davidson
Woodside CA.
aed@netcom.COM
-----------------------------------------------------------------