From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29970 invoked by alias); 20 May 2005 10:02:38 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 29755 invoked from network); 20 May 2005 10:02:25 -0000 Received: from unknown (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org with SMTP; 20 May 2005 10:02:25 -0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id j4KA2PuM026608 for ; Fri, 20 May 2005 12:02:25 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id j4KA2PCS026607 for binutils@sources.redhat.com; Fri, 20 May 2005 12:02:25 +0200 Date: Fri, 20 May 2005 11:31:00 -0000 From: Jakub Jelinek To: binutils@sources.redhat.com Subject: Re: --as-needed handling of shared libraries that fail -Wl,-z,defs Message-ID: <20050520100225.GC7663@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek References: <20050519163716.GD22344@sunsite.mff.cuni.cz> <20050520095349.GL27573@bubble.grove.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050520095349.GL27573@bubble.grove.modra.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-05/txt/msg00613.txt.bz2 On Fri, May 20, 2005 at 07:23:49PM +0930, Alan Modra wrote: > On Thu, May 19, 2005 at 06:37:16PM +0200, Jakub Jelinek wrote: > > --as-needed doesn't seem to try satisfy undefined references in shared > > libraries: > > No, as the ld doc says it "causes DT_NEEDED tags to only be emitted > for libraries that satisfy some symbol reference from regular objects > which is undefined at the point that the library was linked." Ok, fine, no problem with that. But in that case we should issue an error about unsatisfied references. gcc -o /tmp/nothing{,.c} -Wl,-u,readline -lreadline /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetnum' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgoto' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetflag' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `BC' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tputs' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `PC' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetent' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `UP' /usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libreadline.so: undefined reference to `tgetstr' collect2: ld returned 1 exit status gcc -o /tmp/nothing{,.c} -Wl,-u,readline -lreadline -Wl,--as-needed -ltermcap -Wl,--no-as-needed; /tmp/nothing /tmp/nothing: symbol lookup error: /usr/lib64/libreadline.so.4: undefined symbol: BC Jakub