Bob Cowling (cowling++at++torus.autometric.com)
Mon, 10 Feb 1997 09:52:55 -0500
In your case, since you have two "g"s in your executable, you do want to remain
using dlopen (vs. sgidladd). This will prevent the ambiguity of which "g" is
actually being used.
Use the handle returned from the dlopen to access the variable "g" in the
second DSO.
For example (from man dlsym)
void *handle;
int i, *iptr;
int (*fptr)(int);
/* open the needed object */
handle = dlopen("/usr/mydir/libx.so", RTLD_LAZY);
/* find address of function and data objects */
fptr = (int (*)(int))dlsym(handle, "some_function");
iptr = (int *)dlsym(handle, "int_object");
/* invoke function, passing value of integer as a parameter */
i = (*fptr)(*iptr);
DSOs are Cool!
Bob
--
--------------------------------------------------------------------
Robert Cowling cowling++at++autometric.com
Director, Product Engineering (703) 658-4035
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:37 PDT