From owner-freebsd-hackers Mon Sep 14 18:54:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA08206 for freebsd-hackers-outgoing; Mon, 14 Sep 1998 18:54:36 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA08196 for ; Mon, 14 Sep 1998 18:54:31 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id SAA24867; Mon, 14 Sep 1998 18:54:14 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp04.primenet.com, id smtpd024842; Mon Sep 14 18:54:07 1998 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id SAA12519; Mon, 14 Sep 1998 18:54:03 -0700 (MST) From: Terry Lambert Message-Id: <199809150154.SAA12519@usr05.primenet.com> Subject: Re: Unused functions To: joelh@gnu.org Date: Tue, 15 Sep 1998 01:54:03 +0000 (GMT) Cc: tlambert@primenet.com, graphix@iastate.edu, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199809142240.RAA09355@detlev.UUCP> from "Joel Ray Holveck" at Sep 14, 98 05:40:44 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > What can be done in the compiler and linker alone? If an object file > contains both foo() and bar(), and foo calls bar, the linker doesn't > know that. What? Then how can my definition of "printf" override the library definition? The object file format certainly knows about intra-object dependencies. > Neither does it know about static baz(), which only quux() > calls. True. > The user program doesn't call quux, and therefore doesn't call > baz, but the linker doesn't know that. False. Libraries are *not* stripped. There is also a difference between strip, strip -d, and strip -x. if -x was used, then the symbol will have been eliminated, and the code dependency will be known (or agregated). If you aim the gun at your foot and pull the trigger, it's UNIX's job to ensure reliable delivery of the bullet to where you aimed the gun (in this case, Mr. Foot). > I don't see any way to resolve the issue without instrumenting the > object file (perhaps by extending stabs?). If that were to be done, > then something similar to lorder would do the trick. That's what symbols are for. There are alread sufficient symbols tro support this (presuing you don't -x anything). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message