home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / libdl / dlopen.z / dlopen
Encoding:
Text File  |  1998-10-30  |  28.7 KB  |  397 lines

  1.  
  2.  
  3.  
  4. DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))                                                          DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ddddllllooooppppeeeennnn - open a shared object
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      cccccccc [ffffllllaaaagggg ...] ffffiiiilllleeee ...  ----llllcccc [lllliiiibbbbrrrraaaarrrryyyy ...]
  13.  
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddllllffffccccnnnn....hhhh>>>>
  15.  
  16.      vvvvooooiiiidddd ****ddddllllooooppppeeeennnn((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ppppaaaatttthhhhnnnnaaaammmmeeee,,,, iiiinnnntttt mmmmooooddddeeee))));;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      ddddllllooooppppeeeennnn is one of a family of routines that give the user direct access to
  20.      the dynamic linking facilities. These routines are available in a library
  21.      which is loaded if the option ----llllcccc is used with cccccccc , ffff77777777 or lllldddd.
  22.  
  23.      ddddllllooooppppeeeennnn makes a shared object available to a running process.  ddddllllooooppppeeeennnn
  24.      returns to the process a _h_a_n_d_l_e which the process may use on subsequent
  25.      calls to ddddllllssssyyyymmmm and ddddllllcccclllloooosssseeee.  This _h_a_n_d_l_e should not be interpreted in any
  26.      way by the process.  _p_a_t_h_n_a_m_e is the path name of the object to be
  27.      opened; it may be an absolute path or relative to the current directory.
  28.      If the value of _p_a_t_h_n_a_m_e is 0, ddddllllooooppppeeeennnn makes the symbols contained in the
  29.      original aaaa....oooouuuutttt, and all of the objects that were loaded at program
  30.      startup with the aaaa....oooouuuutttt, available through ddddllllssssyyyymmmm.
  31.  
  32.      When a shared object is brought into the address space of a process, it
  33.      may contain references to symbols whose addresses are not known until the
  34.      object is loaded.  These references must be relocated before the symbols
  35.      can be accessed. The _m_o_d_e parameter governs when these relocations take
  36.      place and may have the following values:
  37.  
  38.      RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY
  39.           Only references to data symbols are relocated when the object is
  40.           loaded.  References to functions are not relocated until a given
  41.           function is invoked for the first time.  This _m_o_d_e should result in
  42.           the best performance, since a process may not reference all of the
  43.           functions in any given shared object.  RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY cannot be combined
  44.           with RRRRTTTTLLLLDDDD____NNNNOOOOWWWW.
  45.  
  46.      RRRRTTTTLLLLDDDD____NNNNOOOOWWWW
  47.           All necessary relocations are performed when the object is first
  48.           loaded.  This may result in some wasted effort if relocations are
  49.           performed for functions that are never referenced, but is useful for
  50.           programs that need to know as soon as an object is loaded that all
  51.           symbols referenced during execution are available.  RRRRTTTTLLLLDDDD____NNNNOOOOWWWW cannot
  52.           be combined with RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY.
  53.  
  54.      RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL
  55.           modifies the treatment of the symbols in the DSO being opened to be
  56.           identical to those of ssssggggiiii____ddddllllaaaadddddddd().  RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL may be or'd with
  57.           either RRRRTTTTLLLLDDDD____NNNNOOOOWWWW or RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY (RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL cannot be the mmmmooooddddeeee value
  58.           on its own).  RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL See "NAMESPACE ISSUES" below for more on
  59.           the impact of using or not using RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL.  With RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL the
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))                                                          DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))
  71.  
  72.  
  73.  
  74.           _h_a_n_d_l_e is less necessary than without it, since _r_l_d directly
  75.           resolves references to symbols when RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL is provided and
  76.           _d_l_s_y_m is not needed.
  77.  
  78.      The following is an example of use, using -32.
  79.           _dddd_llll_tttt_rrrr_yyyy_...._cccc_::::
  80.           _----_----_----_----_----_----_----
  81.           _////_**** _EEEE_rrrr_rrrr_oooo_rrrr _hhhh_aaaa_nnnn_dddd_llll_iiii_nnnn_gggg _cccc_oooo_dddd_eeee _nnnn_oooo_tttt _ssss_hhhh_oooo_wwww_nnnn_....
  82.           _****_////
  83.           _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_dddd_llll_ffff_cccc_nnnn_...._hhhh_>>>>
  84.  
  85.           _tttt_yyyy_pppp_eeee_dddd_eeee_ffff _iiii_nnnn_tttt _((((_****_xxxx_aaaa_mmmm_pppp_llll_eeee_ffff_uuuu_nnnn_cccc_pppp_tttt_rrrr_))))_((((_iiii_nnnn_tttt_))))_;;;;
  86.           _iiii_nnnn_tttt _mmmm_aaaa_iiii_nnnn_((((_))))
  87.           _{{{{
  88.              _vvvv_oooo_iiii_dddd _****_hhhh_aaaa_nnnn_dddd_llll_eeee_;;;;
  89.              _iiii_nnnn_tttt   _iiii_;;;;
  90.              _xxxx_aaaa_mmmm_pppp_llll_eeee_ffff_uuuu_nnnn_cccc_pppp_tttt_rrrr _ffff_pppp_tttt_rrrr_;;;;
  91.  
  92.              _hhhh_aaaa_nnnn_dddd_llll_eeee _==== _dddd_llll_oooo_pppp_eeee_nnnn_((((_""""_gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_...._ssss_oooo_""""_,,,, _RRRR_TTTT_LLLL_DDDD______LLLL_AAAA_ZZZZ_YYYY_))))_;;;;
  93.              _ffff_pppp_tttt_rrrr _==== _((((_xxxx_aaaa_mmmm_pppp_llll_eeee_ffff_uuuu_nnnn_cccc_pppp_tttt_rrrr_))))_dddd_llll_ssss_yyyy_mmmm_((((_hhhh_aaaa_nnnn_dddd_llll_eeee_,,,, _""""_gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_""""_))))_;;;;
  94.              _iiii _==== _((((_****_ffff_pppp_tttt_rrrr_))))_((((_3333_))))_;;;;
  95.              _rrrr_eeee_tttt_uuuu_rrrr_nnnn _0000_;;;;
  96.           _}}}}
  97.  
  98.           _gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_...._cccc_::::
  99.           _----_----_----_----_----_----_----_----_----_----_----
  100.           _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>
  101.           _iiii_nnnn_tttt _gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_((((_iiii_nnnn_tttt _nnnn_uuuu_mmmm______gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_))))
  102.           _{{{{
  103.              _iiii_nnnn_tttt _iiii_;;;;
  104.  
  105.              _ffff_oooo_rrrr _((((_iiii_====_0000_;;;; _iiii _<<<< _nnnn_uuuu_mmmm______gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_;;;; _iiii_++++_++++_))))
  106.                 _pppp_rrrr_iiii_nnnn_tttt_ffff _((((_""""_hhhh_eeee_llll_llll_oooo _wwww_oooo_rrrr_llll_dddd_0000_))))_;;;;
  107.              _rrrr_eeee_tttt_uuuu_rrrr_nnnn _1111_;;;;
  108.           _}}}}
  109.  
  110.  
  111.           _%%%% _cccc_cccc _----_3333_2222 _----_cccc _dddd_llll_tttt_rrrr_yyyy_...._cccc _gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_...._cccc
  112.           _%%%% _llll_dddd _----_3333_2222 _----_ssss_hhhh_aaaa_rrrr_eeee_dddd _gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_...._oooo _\\\\
  113.           _----_ssss_oooo_nnnn_aaaa_mmmm_eeee _gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_...._ssss_oooo _----_oooo _gggg_rrrr_eeee_eeee_tttt_iiii_nnnn_gggg_ssss_...._ssss_oooo
  114.           _%%%% _cccc_cccc _----_3333_2222 _dddd_llll_tttt_rrrr_yyyy_...._oooo
  115.           _%%%% _aaaa_...._oooo_uuuu_tttt
  116.           _hhhh_eeee_llll_llll_oooo _wwww_oooo_rrrr_llll_dddd
  117.           _hhhh_eeee_llll_llll_oooo _wwww_oooo_rrrr_llll_dddd
  118.           _hhhh_eeee_llll_llll_oooo _wwww_oooo_rrrr_llll_dddd
  119.  
  120. NNNNAAAAMMMMEEEESSSSPPPPAAAACCCCEEEE IIIISSSSSSSSUUUUEEEESSSS
  121.      This section does not address symbol resolution from ddddllllssssyyyymmmm(3).  See ddddllllssssyyyymmmm
  122.      for details on its symbol resolution rules.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))                                                          DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))
  137.  
  138.  
  139.  
  140.      Name resolution can become surprisingly complicated and non-intuitive in
  141.      the presence of programs or DSOs using ddddllllooooppppeeeennnn, ssssggggiiiiddddllllaaaadddddddd,
  142.      ssssggggiiii____ddddllllooooppppeeeennnn____vvvveeeerrrrssssiiiioooonnnn, or LLLLLLLL____DDDDEEEELLLLAAAAYYYY____LLLLOOOOAAAADDDD (the _l_d -_d_e_l_a_y__l_o_a_d option).
  143.  
  144.      Any case in which there is only one definition of a symbol across all
  145.      loaded DSOs is simple: that definition is used if it is visible
  146.      (visibility is discussed below).
  147.  
  148.      Name searches are done in the order of a single list, the rld-list.  The
  149.      first rld-list entry is the program itself.  Following that is the list
  150.      of DSOs currently in the runtime of the program.  At program startup a
  151.      breadth-first list of DSOs in the program (and, recursively their library
  152.      lists) is formed in the rld-list.  No DSO is added to the rld-list twice
  153.      (later encounters of a DSO in simply use the earlier occurrence, but see
  154.      NOTES below for an exception).  For any DSO library list entry marked
  155.      LLLLLLLL____DDDDEEEELLLLAAAAYYYY____LLLLOOOOAAAADDDD the DSO referenced is not loaded at program startup.
  156.  
  157.      The above name search rule has an exception.  If a DSO is marked as
  158.      DT_SYMBOLIC (see the _l_d option ----BBBB ssssyyyymmmmbbbboooolllliiiicccc) then all name searches from
  159.      within that DSO begin at the DSO itself and continue with the standard
  160.      rld-list search.
  161.  
  162.      When, as a result of a call to  a function in a LLLLLLLL____DDDDEEEELLLLAAAAYYYY____LLLLOOOOAAAADDDDed DSO, that
  163.      DSO is loaded, the new DSO is added at the end of the rld-list (if it has
  164.      any entries in its library list that are not marked LLLLLLLL____DDDDEEEELLLLAAAAYYYY____LLLLOOOOAAAADDDD the
  165.      non-LLLLLLLL____DDDDEEEELLLLAAAAYYYY____LLLLOOOOAAAADDDD DSOs are added, recursively (breadth-first)).  Thus,
  166.      depending on the order of calls to delay-loaded DSOs, the order of DSOs
  167.      on the rld-list may be different from one run of a program to the next.
  168.  
  169.      The order of DSOs in the rld-list may not match the order in any given
  170.      library list because if a DSO is already in the rld-list it is not added
  171.      a second time to the rld-list.
  172.  
  173.      As a result of the rule that the search order is rld-list order, the
  174.      symbol found can be surprising.  Consider a symbol A found in DSOs B and
  175.      C and DSO B is before DSO C in E's liblist while DSO B is after DSO C in
  176.      F's liblist.  Lets specify that neither DSO B nor DSO C are otherwise
  177.      referenced.  If DSO E is ddddllllooooppppeeeennnn((((............RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL))))ed before DSO F then the A
  178.      from DSO B is found by ddddllllssssyyyymmmm from either handle.  While if DSO F is
  179.      ddddllllooooppppeeeennnn((((............RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL))))ed before DSO E then the A from DSO C is found by
  180.      ddddllllssssyyyymmmm from either handle.  On the other hand, if only one of the DSOs E
  181.      or F is ddddllllooooppppeeeennnn((((............RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL))))ed then one gets DSO B's A from DSO E's
  182.      handle and one gets DSO C's A from DSO F's handle.
  183.  
  184.      Note that _d_l_c_l_o_s_e does not cause any reordering of the rld-list: when the
  185.      last handle (direct or indirect) on a DSO is _d_l_c_l_o_s_ed the DSO is removed
  186.      from the rld-list.  Before the final _d_l_c_l_o_s_e the DSO remains where it was
  187.      on the rld-list.
  188.  
  189.      Now we turn to the issue of symbol visibility.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))                                                          DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))
  203.  
  204.  
  205.  
  206.      DSOs loaded by a single invocation of ddddllllooooppppeeeennnn may import symbols from one
  207.      another or from any DSO which is globally-visible, but DSOs loaded by one
  208.      ddddllllooooppppeeeennnn invocation may not directly reference symbols from DSOs loaded by
  209.      a different ddddllllooooppppeeeennnn invocation. Those symbols may, however, be referenced
  210.      indirectly using ddddllllssssyyyymmmm.
  211.  
  212.      Globally-visible DSOs are those added at program startup or via delay-
  213.      load from a globally-visible object.  In addition, any DSO added by
  214.      ssssggggiiiiddddllllaaaadddddddd or ddddllllooooppppeeeennnn((((............RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL............)))) or
  215.      ssssggggiiiiddddllllooooppppeeeennnn____vvvveeeerrrrssssiiiioooonnnn((((............RRRRTTTTLLLLDDDD____GGGGLLLLOOOOBBBBAAAALLLL............)))) is globally-visible.
  216.  
  217.      Even in a globally-visible DSO a symbol is invisible to any access from
  218.      outside the DSO if the symbol is marked SSSSTTTTOOOO____HHHHIIIIDDDDDDDDEEEENNNN (see the _l_d options
  219.      ----hhhhiiiiddddddddeeeennnn____ssssyyyymmmmbbbboooollll or ----hhhhiiiiddddeeeessss____ffffiiiilllleeee for example).  From within a DSO, all
  220.      symbols in that DSO are visible.  From within a DSO, all globally-visible
  221.      symbols are visible.
  222.  
  223.      Consider a set of DSOs.
  224.  
  225.      ld -shared -all F.a -o F.so
  226.      ld -shared -all G.a -o G.so
  227.      ld -shared -all E.a F.so G.so -o E.so
  228.      ld -shared -all H.a F.so  -o H.so
  229.  
  230.      Say a program does dlopen("E.so",RTLD_LAZY) and and
  231.      dlopen("H.so",RTLD_LAZY) and uses _d_l_s_y_m to find functions through the two
  232.      _h_a_n_d_l_es and calls these two functions. Say each of these calls a function
  233.      that calls ff() in F.so. Say that ff() calls fg() which is only defined
  234.      in G.so. Logically one would say that the call through the function
  235.      accessed via E.so should resolve to fg() in G.so and one would think that
  236.      the call thru the function accessed via H.so should result in an
  237.      undefined function.  However, _r_l_d does not attempt to determine (by
  238.      walking the run-time stack or other means) the exact call-stack to ff()
  239.      (the call-stack is not really enough: _r_l_d needs to know the _h_a_n_d_l_e used
  240.      to derive the calls!).  The result of the call to fg() is undefined.
  241.      What happens is that fg() in G.so is called, since such would be legal if
  242.      the call path were thru E.so's _h_a_n_d_l_e.  It is unwise to depend on such
  243.      behavior.
  244.  
  245. SSSSEEEEAAAARRRRCCCCHHHHIIIINNNNGGGG FFFFOOOORRRR SSSSHHHHAAAARRRREEEEDDDD OOOOBBBBJJJJEEEECCCCTTTTSSSS
  246.      If other shared objects were link edited with _p_a_t_h_n_a_m_e when _p_a_t_h_n_a_m_e was
  247.      built, those objects are automatically loaded by ddddllllooooppppeeeennnn (subject to the
  248.      LLLLLLLL____DDDDEEEELLLLAAAAYYYY____LLLLOOOOAAAADDDD library list flag).  The directory search path that is used
  249.      to find both _p_a_t_h_n_a_m_e and the other _n_e_e_d_e_d objects is the same as that
  250.      used by rrrrlllldddd(1).  In particular, _p_a_t_h_n_a_m_e is searched for in
  251.  
  252.      1) the directory specified by _p_a_t_h_n_a_m_e if it is not a simple file name
  253.      (_i._e.  it contains a //// character).  In this case, the exact file is the
  254.      only placed searched; steps two through four below are ignored.
  255.  
  256.      2) any path specified via the ----rrrrppppaaaatttthhhh argument to lllldddd(1) when the
  257.      executable was statically linked.
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))                                                          DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))
  269.  
  270.  
  271.  
  272.      3) any directory specified by the environment variable LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY____PPPPAAAATTTTHHHH.
  273.      This environment variable should contain a colon-separated list of
  274.      directories, in the same format as the PPPPAAAATTTTHHHH variable [see sssshhhh(1)].  64-bit
  275.      programs examine the variable LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY66664444____PPPPAAAATTTTHHHH, and if it is not set
  276.      LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY____PPPPAAAATTTTHHHH is examined.  New 32-bit ABI programs examine the
  277.      variable LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYYNNNN33332222____PPPPAAAATTTTHHHH and if it is not set LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY____PPPPAAAATTTTHHHH is
  278.      examined.
  279.  
  280.      All of these variables are ignored if the process is running sssseeeettttuuuuiiiidddd or
  281.      sssseeeettttggggiiiidddd [see eeeexxxxeeeecccc(2)].
  282.  
  283.      4) the default search paths are used.  These are ////uuuussssrrrr////lllliiiibbbb::::////lllliiiibbbb for 32-bit
  284.      programs, ////uuuussssrrrr////lllliiiibbbb66664444::::////lllliiiibbbb66664444 for 64-bit programs, and ////uuuussssrrrr////lllliiiibbbb33332222::::////lllliiiibbbb33332222
  285.      for new 32-bit ABI programs.
  286.  
  287.      The variable ____RRRRLLLLDDDD____RRRROOOOOOOOTTTT has its usual effect, as documented on rrrrlllldddd(1)
  288.      (which means that if the process is running sssseeeettttuuuuiiiidddd or sssseeeettttggggiiiidddd ____RRRRLLLLDDDD____RRRROOOOOOOOTTTT is
  289.      ignored).
  290.  
  291. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  292.      ddddlllleeeerrrrrrrroooorrrr(3), ddddllllcccclllloooosssseeee(3), ssssggggiiiiddddllllaaaadddddddd(3), ssssggggiiiiddddllllooooppppeeeennnn____vvvveeeerrrrssssiiiioooonnnn(3), ddddllllssssyyyymmmm(3),
  293.      ddddssssoooo(5).
  294.  
  295. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  296.      If _p_a_t_h_n_a_m_e cannot be found, cannot be opened for reading, is not a
  297.      shared object, or if an error occurs during the process of loading
  298.      _p_a_t_h_n_a_m_e or relocating its symbolic references, ddddllllooooppppeeeennnn returns NNNNUUUULLLLLLLL.
  299.      More detailed diagnostic information is available through ddddlllleeeerrrrrrrroooorrrr.
  300.  
  301. NNNNOOOOTTTTEEEESSSS
  302.      Objects whose names resolve to the same absolute or relative path name
  303.      may be opened any number of times using ddddllllooooppppeeeennnn, however, the object
  304.      referenced is only loaded once into the address space of the current
  305.      process.  The same object referenced by two different path names,
  306.      however, may be loaded multiple times.  For example, given the object
  307.      ////uuuussssrrrr////hhhhoooommmmeeee////mmmmeeee////mmmmyyyylllliiiibbbbssss////mmmmyyyylllliiiibbbb....ssssoooo, and assuming the current working directory
  308.      is ////uuuussssrrrr////hhhhoooommmmeeee////mmmmeeee////wwwwoooorrrrkkkkddddiiiirrrr,
  309.  
  310.           ............
  311.           vvvvooooiiiidddd ****hhhhaaaannnnddddlllleeee1111;;;;
  312.           vvvvooooiiiidddd ****hhhhaaaannnnddddlllleeee2222;;;;
  313.  
  314.           hhhhaaaannnnddddlllleeee1111 ==== ddddllllooooppppeeeennnn((((""""........////mmmmyyyylllliiiibbbbssss////mmmmyyyylllliiiibbbb....ssssoooo"""",,,, RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY))));;;;
  315.           hhhhaaaannnnddddlllleeee2222 ==== ddddllllooooppppeeeennnn((((""""////uuuussssrrrr////hhhhoooommmmeeee////mmmmeeee////mmmmyyyylllliiiibbbbssss////mmmmyyyylllliiiibbbb....ssssoooo"""",,,, RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY))));;;;
  316.           ............
  317.  
  318.      results in mmmmyyyylllliiiibbbbssss....ssssoooo being loaded twice for the current process.  On the
  319.      other hand, given the same object and current working directory, if
  320.      LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY____PPPPAAAATTTTHHHH====////uuuussssrrrr////hhhhoooommmmeeee////mmmmeeee////mmmmyyyylllliiiibbbbssss, then
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))                                                          DDDDLLLLOOOOPPPPEEEENNNN((((3333CCCC))))
  335.  
  336.  
  337.  
  338.           ............
  339.           vvvvooooiiiidddd ****hhhhaaaannnnddddlllleeee1111;;;;
  340.           vvvvooooiiiidddd ****hhhhaaaannnnddddlllleeee2222;;;;
  341.  
  342.           hhhhaaaannnnddddlllleeee1111 ==== ddddllllooooppppeeeennnn((((""""mmmmyyyylllliiiibbbb....ssssoooo"""",,,, RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY))));;;;
  343.           hhhhaaaannnnddddlllleeee2222 ==== ddddllllooooppppeeeennnn((((""""////uuuussssrrrr////hhhhoooommmmeeee////mmmmeeee////mmmmyyyylllliiiibbbbssss////mmmmyyyylllliiiibbbb....ssssoooo"""",,,, RRRRTTTTLLLLDDDD____LLLLAAAAZZZZYYYY))));;;;
  344.           ............
  345.  
  346.      results in mmmmyyyylllliiiibbbbssss....ssssoooo being loaded only once. Users who wish to gain
  347.      access to the symbol table of the aaaa....oooouuuutttt itself using ddddllllssssyyyymmmm((((0000,,,, mmmmooooddddeeee))))
  348.      should be aware that some symbols defined in the aaaa....oooouuuutttt may not be
  349.      available to the dynamic linker.  The symbol table created by lllldddd for use
  350.      by the dynamic linker might contain only a subset of the symbols defined
  351.      in the aaaa....oooouuuutttt:  specifically those referenced by the shared objects with
  352.      which the aaaa....oooouuuutttt is linked.
  353.  
  354.      A program built non_shared (with cc -non_shared for example) cannot
  355.      usefully call _d_l_o_p_e_n(), _d_l_s_y_m(), _d_l_e_r_r_o_r(), _s_g_i_d_l_o_p_e_n__v_e_r_s_i_o_n(),
  356.      _s_g_i_d_l_a_d_d(), or _d_l_c_l_o_s_e() since there is no defined mechanism for dynamic
  357.      loading in non_shared programs.  The dynamic loading routines are not
  358.      included in the non_shared _l_i_b_c._a so attempting to use them may result in
  359.      a failure at link time.  Any program built non_shared that wishes to
  360.      retain code calling the dynamic loading routines must implement its own
  361.      versions of _d_l_o_p_e_n, _d_l_s_y_m(3), etc. and simply return appropriate error
  362.      values to avoid the link-time errors.  (Building programs non_shared is
  363.      not generally recommended.  Not all libraries are available non_shared.)
  364.  
  365.      Use of ddddllllcccclllloooosssseeee on a DSO can cause surprising side effects because ddddllllcccclllloooosssseeee
  366.      forces many symbol GOT entries to be reset for re-lazy-evaluation.  A
  367.      result of this is that previously-saved (by the application or some
  368.      library) function pointers may hold values that could be obsolete or no
  369.      longer correct.  This is a problem for any ddddllllcccclllloooosssseeee but is more serious
  370.      (can cause more surprises) when ddddllllcccclllloooosssseeeeing a _h_a_n_d_l_e on a globally-visible
  371.      DSO.
  372.  
  373.      Symbol lookups proceed in order on a linear list, and a DSO is not opened
  374.      twice with the same version number  (unless different dlopen paths make
  375.      the DSO name appear different to _r_l_d).  When multiple ssssggggiiiiddddllllaaaadddddddds are done
  376.      and an earlier DSO is ddddllllcccclllloooosssseeeed this can change what symbol a call is
  377.      resolved to.  See "NAMESPACE ISSUES" above.
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.