home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / hp / 12732 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  2.8 KB

  1. From: cdb@hpcuhe.cup.hp.com (Carl Burch)
  2. Date: Tue, 10 Nov 1992 02:39:31 GMT
  3. Subject: Re: Changing a shared library into a non-shared library
  4. Message-ID: <31480281@hpcuhe.cup.hp.com>
  5. Organization: Hewlett Packard, Cupertino
  6. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!scd.hp.com!hpscdm!hplextra!hpcss01!hpcuhe!cdb
  7. Newsgroups: comp.sys.hp
  8. References: <1992Nov9.041051.3266@codex.oz.au>
  9. Lines: 49
  10.  
  11.  
  12. > The real question:
  13.    Thanks for putting this in - it allows us to suggest other approaches
  14. beyond your original question.  I recommend it as a practice.  
  15.  
  16.    In this case, Curt Wohlgemuth has answered the original question
  17. correctly :  you can't get there from here.  Generically, the linker
  18. destroys so much information when linking a shlib (or a.out) that there's no
  19. way to put it back together into a .o.
  20.  
  21. > I have a shared library which I want to add new objects to. I don't have the  
  22. > source to the shared lib. Hence, I need to find a way to feed an existing  
  23. > shared library through the linker. (I think).
  24. > I'd like to be able to issue a command like the following:
  25. >     ld -b myshlib.sl myobj.o -o myshlib.new.sl
  26. > With the new shared library, containing everything from myshlib.sl + 
  27. > everything from myobj.o, in myshlib.new.sl
  28.  
  29.    WARNING : Some purists would consider the following a kludge.  They
  30. may feel free to suggest an elegant and non-kludgy alternative, or stop
  31. reading here.  People that need to get the job done, read on.
  32.  
  33.    Since all you want to do is add (not replace) modules, you can use the
  34. dependent libraries functionality to make the old library a dependent
  35. library of a new shlib containing the code you want to add.  You then move
  36. aside the old library and put the new shlib in its place.  Both shlibs will
  37. be loaded when the new one is referenced (by the old name).  Your example
  38. would then look like :
  39.  
  40.     mv myshlib.sl myshlib.orig.sl
  41.      ld -b myobj.o  -o myshlib.sl  myshlib.orig.sl
  42.  
  43.    You should be careful of whether the pathname embedded in the new shlib
  44. is absolute or relative.  E.g., you might need :
  45.      ld -b myobj.o -o myshlib.sl `pwd`/myshlib.orig.sl
  46.  
  47.    You don't say which Series 700 UX8.x release you're on.  There is
  48. additional functionality in UX9.0 to make this more flexible, as well as a
  49. significant defect repair for data shared between dependent shlibs.  Readers
  50. on Series 800/8.0 are invited to update to 9.0 where the dependent libraries
  51. functionality will appear in the S800 line.  I recommend reading ALL of
  52. "Programming on HP-UX" (Part # B2355-90026 E0892) before getting this far
  53. into building shared libraries.
  54.  
  55.                         Carl Burch
  56.                         HP California Language Lab
  57. --------------------------------------------------------------------------
  58. If I got paid about an order of magnitude more, somebody might seriously
  59. think I spoke for HP about anything.
  60.