This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: How to stop ld from searching dependend libs?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Richter, Jörg <Joerg dot Richter at pdv-FS dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 23 May 2005 08:46:49 -0400
- Subject: Re: How to stop ld from searching dependend libs?
- References: <BE04DD7F49713C4C94B1A89A81CEFE1C389AD0@exch03.pdv-fs.de>
On Mon, May 23, 2005 at 10:56:07AM +0200, Richter, Jörg wrote:
> How can I make ld behave the same like in (2) when building (1)?
>
> To be exact: I want ld to print an error when the user hasn't
> supplied all libs he needs to build the executable. So I want the
> simple behavior and not the nifty dependend lib searching algorithm
> that ld uses in case (1). Is there an option to achieve this? I read
> 'man ld' up and down and found nothing. Perhaps i'm just blind...
I don't think you can get ld to do that without removing the reference
to libB.so when linking libA.so; which is a bad idea on its own.
I don't know why you get the error when linking a shared library. I
would not have expected to see it. There's this bit of code in
gld*_after_open which is responsible:
/* We only need to worry about this when doing a final link. */
if (link_info.relocatable || !link_info.executable)
return;
But I would have expected to do DT_NEEDED checks for shared libraries
also.
--
Daniel Jacobowitz
CodeSourcery, LLC