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