From owner-freebsd-questions@FreeBSD.ORG Tue Jun 17 09:51:34 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 131B437B401; Tue, 17 Jun 2003 09:51:34 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1513843F85; Tue, 17 Jun 2003 09:51:33 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5HGpWDZ055821; Tue, 17 Jun 2003 09:51:32 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5HGpWst000886; Tue, 17 Jun 2003 09:51:32 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h5HGpW98000885; Tue, 17 Jun 2003 09:51:32 -0700 (PDT) (envelope-from marcel) Date: Tue, 17 Jun 2003 09:51:32 -0700 From: Marcel Moolenaar To: Joe Kelsey Message-ID: <20030617165132.GE584@dhcp01.pn.xcllnt.net> References: <3EEE4717.2090409@mail.flyingcroc.net> <1055804020.79093.2.camel@rushlight.kf8nh.apk.net> <3EEF19D5.9040706@mail.flyingcroc.net> <20030617154208.GA584@dhcp01.pn.xcllnt.net> <3EEF3883.1080500@mail.flyingcroc.net> <20030617160141.GB584@dhcp01.pn.xcllnt.net> <3EEF3E10.8030205@mail.flyingcroc.net> <20030617162302.GC584@dhcp01.pn.xcllnt.net> <3EEF427A.1080106@mail.flyingcroc.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EEF427A.1080106@mail.flyingcroc.net> User-Agent: Mutt/1.5.4i cc: stable@freebsd.org cc: questions@freebsd.org Subject: Re: Tools to modify shared libraries X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2003 16:51:34 -0000 On Tue, Jun 17, 2003 at 09:31:54AM -0700, Joe Kelsey wrote: > Marcel Moolenaar wrote: > >Yes it can. Symbol resolution is a fundamental part in linking. > >Hence, the linker has all the information it needs to filter the > >gratuitously long list of libraries programmers tend to give it > >and keep the libraries that actually contributed to the link. > > > > I know of no way to do this in the case of shared libraries. When > linking shared libraries, the linker *cannot* resolve any references to > other shared libraries other than list them in the .dynamic section with > some sort of tag such as DT_NEEDED. Please explain to me how the linker > can prune the shared library list at link time. If a symbol is unresolved, it must be present in one of the libraries on the link line. If the symbol is in an archive library, you pull in the code. Otherwise, if it's in a shared library, you record the dependency on that library. In the end you have no unresolved symbols, all code from archives has been linked in and you have a complete list of dependencies that is a subset of the libraries given on the command line. For partial linking (incremental linking) the list of unresolved symbols does not have to be empty. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net