DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(libtool14.info.gz) Dlpreopening

Info Catalog (libtool14.info.gz) Building modules (libtool14.info.gz) Dlopened modules (libtool14.info.gz) Finding the dlname
 
 9.2 Dlpreopening
 ================
 
 Libtool provides special support for dlopening libtool object and
 libtool library files, so that their symbols can be resolved _even on
 platforms without any `dlopen' and `dlsym' functions_.
 
    Consider the following alternative ways of loading code into your
 program, in order of increasing "laziness":
 
   1. Linking against object files that become part of the program
      executable, whether or not they are referenced.  If an object file
      cannot be found, then the linker refuses to create the executable.
 
   2. Declaring a static library to the linker, so that it is searched
      at link time in order to satisfy any undefined references in the
      above object files.  If the static library cannot be found, then
      the linker refuses to link the executable.
 
   3. Declaring a shared library to the runtime linker, so that it is
      searched at runtime in order to satisfy any undefined references
      in the above files.  If the shared library cannot be found, then
      the dynamic linker aborts the program before it runs.
 
   4. Dlopening a module, so that the application can resolve its own,
      dynamically-computed references.  If there is an error opening the
      module, or the module is not found, then the application can
      recover without crashing.
 
    Libtool emulates `-dlopen' on static platforms by linking objects
 into the program at compile time, and creating data structures that
 represent the program's symbol table.
 
    In order to use this feature, you must declare the objects you want
 your application to dlopen by using the `-dlopen' or `-dlpreopen' flags
 when you link your program ( Link mode).
 
  -- Structure: struct lt_dlsymlist { const char *NAME; lt_ptr ADDRESS; }
      The NAME attribute is a null-terminated character string of the
      symbol name, such as `"fprintf"'.  The ADDRESS attribute is a
      generic pointer to the appropriate object, such as `&fprintf'.
 
  -- Variable: const lt_dlsymlist * lt_preloaded_symbols
      An array of LT_SYMBOL structures, representing all the preloaded
      symbols linked into the program. For each `-dlpreloaded' file
      there is an element with the NAME of the file and a ADDRESS of
      `0', followed by all symbols exported from this file.  For the
      executable itself the special name @PROGRAM@ is used.  The last
      element has a NAME and ADDRESS of `0'.
 
    Some compilers may allow identifiers which are not valid in ANSI C,
 such as dollar signs.  Libtool only recognizes valid ANSI C symbols (an
 initial ASCII letter or underscore, followed by zero or more ASCII
 letters, digits, and underscores), so non-ANSI symbols will not appear
 in LT_PRELOADED_SYMBOLS.
 
Info Catalog (libtool14.info.gz) Building modules (libtool14.info.gz) Dlopened modules (libtool14.info.gz) Finding the dlname
automatically generated byinfo2html