www.delorie.com/gnu/docs/dld/dld_12.html   search  
 
Buy GNU books!


Dld

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7 Explicitly Referencing a Symbol

Normally, a library module is loaded only when it defines one of more symbols that has been referenced. To force a library routine to be loaded, one need to explicitly create a reference to a symbol defined by that library routine. The function dld_create_reference is designed for this purpose:

Function: int dld_create_reference (const char *name)
Usually name is the name of the library routine that should be loaded, but it can be any symbol defined by that routine. After such a reference has been created, linking the appropriate library by dld_link would cause the required library routine to be loaded.

If the call is successful, dld_create_reference returns 0; otherwise, it returns a non-zero error code (see section Definition of Error Codes).

The library routine loaded by this method can be unlinked by dld_unlink_by_symbol (name). Once it has been unlinked, the corresponding reference created by dld_create_reference is also removed so that this routine will not be loaded in again by subsequent linking of the library.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003