home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!centerline!franl
- From: franl@centerline.com (Fran Litterio)
- Subject: Re: Linker selection of symbols from shared-libs
- In-Reply-To: franl@centerline.com's message of Fri, 28 Aug 1992 18:25:12 GMT
- Message-ID: <FRANL.92Aug28132919@draco.centerline.com>
- Sender: news@centerline.com
- Nntp-Posting-Host: draco
- Organization: CenterLine Software, Inc.
- References: <3270@tivoli.UUCP> <FRANL.92Aug28132512@draco.centerline.com>
- Date: Fri, 28 Aug 1992 18:29:19 GMT
- Lines: 32
-
- franl@centerline.com (Fran Litterio) writes:
-
- > stuart@TIVOLI.COM (Stuart Jarriel) writes:
- >
- > > Lets say I have a shared lib, libmine.sl, and there is a function in
- > > libmine.sl called write().
- > >
- > > So I build my program with:
- > >
- > > cc program.c -o program -lmine
- > >
- > > will program use the write in libc.sl or in libmine.sl?
- > >
- > > (actually, the answer is libc.sl)
- > >
- > > Can I force the opposite behavior, so that my library can overwrite the
- > > symbols provided in libc.sl?
- >
- > You should be able to use the -L option to make ld(1) look in the
- > directory containing libmine.sl before it looks in /lib and /usr/lib.
-
- Sorry. Ignore my previous posting. The -L option won't help you.
- The cc(1) driver should invoke ld(1) in such a way that libc.sl (or
- libc.a) is scanned last when looking for a defining instance of a
- symbol). You should not have to do anything to get the behavior you
- want. Try invoking ld(1) directly, or try giving the "-Wl,-a,archive"
- option to cc(1) which will force ld(1) to use archive libraries
- instead.
- --
- franl@centerline.com || Fran Litterio
- uunet!centerline!franl || CenterLine Software R&D
- 617-498-3255 || 10 Fawcett St, Cambridge, MA, USA 02138-1110
-