[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vaxaxp::vmsnotes

Title:VAX and Alpha VMS
Notice:This is a new VMSnotes, please read note 2.1
Moderator:VAXAXP::BERNARDO
Created:Wed Jan 22 1997
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:703
Total number of notes:3722

290.0. "dynamic library loading" by CECMOW::GORBATOV () Thu Mar 06 1997 09:39

Hi,

Does VMS support dynamic library loading ( a-la dlopen() in UNIX ) ?
I know that I can link my application with shared library,
but I'm looking for method which is as close to dlopen() as possible.

Thanks in advance,
Sergey.
T.RTitleUserPersonal
Name
DateLines
290.1lib$find_image_symbolNQOS01::nyodialin22.nyo.dec.com::BowersDDave Bowers NSISThu Mar 06 1997 10:0725
This may be the sort og thing you're looking for. I'm not familiar with 
dlopen(), but lib$find_image_symbol allows you to dynamically execute 
functions from a shared image (without linking).

\dave

=============================================================================

RTL_ROUTINES

  LIB$

    LIB$FIND_IMAGE_SYMBOL

         The Find Universal Symbol in Shareable Image File routine reads
         universal symbols from the shareable image file. This routine
         then dynamically activates a shareable image into the P0 address
         space of a process.

         Format

           LIB$FIND_IMAGE_SYMBOL  filename ,symbol ,symbol-value

                                  [,image-name]

290.2Please Log QAR on TRIFID Against VMSDOCXDELTA::HOFFMANSteve, OpenVMS EngineeringThu Mar 06 1997 10:328
:Does VMS support dynamic library loading ( a-la dlopen() in UNIX ) ?
:I know that I can link my application with shared library,
:but I'm looking for method which is as close to dlopen() as possible.

   Please log a QAR against the OpenVMS Master Index, and against
   the documentation -- we should explicitly reference this terminology
   in the master index and in the LIB$FIND_IMAGE_SYMBOL documentation.
   (This quesiton comes up far too often...)
290.3AUSS::GARSONDECcharity Program OfficeThu Mar 06 1997 19:5613
    re .0                                              
    
    Note however that whereas UNIX has separate calls for dlopen() (which
    returns a handle), dlsym() and dlclose() (which use the handle),
    VMS combines the function of dlopen() and dlsym() in the one call,
    LIB$FIND_IMAGE_SYMBOL, which implicitly performs the equivalent of
    dlopen() the first time the image is referenced and VMS does not have
    the equivalent of dlclose().
    
    If porting existing UNIX code I suggest you write emulations of the
    UNIX routines, dlopen and dlsym, (unless a version of VMS later than
    V6.2 includes these in the C RTL). This would be a SMOP. You may have
    to NOP dlclose() and hope the program doesn't rely on it.
290.4TLE::D_SMITHDuane Smith -- DEC C RTLThu Mar 06 1997 21:095
    The DEC C RTL does not contain these functions.  I have written jackets
    which have the dlopen/dlsym/dlclose interface which layer on top of
    lib$find_image_symbol.  Send mail and I can dig them up.
    
    Duane
290.5TLE::D_SMITHDuane Smith -- DEC C RTLFri Mar 07 1997 06:451
    Sergey contacted me offline.