Re: dlopen

New Message Reply Date view Thread view Subject view Author view

Glenn Waldron (gwaldron++at++peril.com)
Mon, 10 Feb 1997 08:18:04 -0500


SWAPNIL H SHAH wrote:
>
> Hello everybody,
>
> if i have global variable called "g" in DSO file "dso1.so" and
> i have one mroe DSO file called "dso2.so"
>
> is it possible to access variable "g" from "dso2.so" by defining it extern?

Somebody correct me if I'm wrong, but:
Two things:
1) use sgidladd() instead of dlopen(). This way all the symbols are
   made available in the name space and there's no need for
   dlsym() (so you don't need the library pointer);
2) To access a symbol in libdso1.so from libdso2.so, you need to "link"
   with libdso1.so when compiling libdso2.so; that is, do a
   "-ldso1" when creating the library libdso2.so. This doesn't
   actually link in the code, but allows any cross-references to be
   resolved. If you don't do this you'll get a runtime linker (rld)
   error when you try to access "g", even is it's dso is loaded.
Glenn.

--------------------------------------------------------------------
Glenn Waldron - ANSER Leading Edge Technologies PCS: 703.598.7835
email: gwaldron++at++peril.com voice mail: 703.416.8462
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:37 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.