home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / hp / 9933 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.8 KB

  1. Path: sparky!uunet!ogicse!hp-cv!hp-pcd!hpfcso!mjs
  2. From: mjs@hpfcso.FC.HP.COM (Marc Sabatella)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: CC and /usr/lib/dld.sl
  5. Message-ID: <7371278@hpfcso.FC.HP.COM>
  6. Date: 1 Sep 92 17:50:55 GMT
  7. Article-I.D.: hpfcso.7371278
  8. References: <1992Sep1.091000.14893@irfu.se>
  9. Organization: Hewlett-Packard, Fort Collins, CO, USA
  10. Lines: 30
  11.  
  12. In comp.sys.hp, jhd@irfu.se (Jan D.) writes:
  13.  
  14. > Anybody know why CC (HP C++ B2402  A.02.34 on a 730, HP-UX 8.07)
  15. > always link in /usr/lib/dld.sl even if you say -Wl,-a,archive?
  16. > What does it do with it and is there anyway to get rid of it?
  17.  
  18. What it does is use shl_get(3X) and shl_findsym(3X) to locate all static
  19. constructors within shared libraries so it can execute them at startup time.
  20. There was no easy way for "CC" to know if this was necessary or not - ie, it
  21. doesn't parse the "ld" options to find out if you are using shared libraries or
  22. not - so it always links in that library.
  23.  
  24. If you don't mind this miniscule use of libdld.sl - one call to shl_get(3X) is
  25. enough to convince CC there are no other shared libraries to worry about, then
  26. just leave things alone.  If for some reason you can't tolerate even the
  27. dependency on libdld.sl, you can use the output of "CC -v" to construct your
  28. own link line (don't forget to run c++patch as shown by "CC -v" as well) and
  29. leave off /usr/lib/libdld.sl, and provide dummy definitions of shl_get(3X) and
  30. shl_findsym(3X).
  31.  
  32. BTW, libC also makes references to shl_load and shl_unload, but those are only
  33. to enable implementation of cxxshl_load and cxxshl_unload; if you aren't using
  34. the latter, you won't need the former.
  35.  
  36. --------------
  37. Marc Sabatella (marc@hpmonk.fc.hp.com)
  38. Disclaimers:
  39.     2 + 2 = 3, for suitably small values of 2
  40.     Bill (H.) and Dave (P.) may not always agree with me
  41.