From owner-freebsd-hackers Mon Sep 14 15:17:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA04006 for freebsd-hackers-outgoing; Mon, 14 Sep 1998 15:17:33 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA03993 for ; Mon, 14 Sep 1998 15:17:30 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id PAA17663; Mon, 14 Sep 1998 15:17:11 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp03.primenet.com, id smtpd017629; Mon Sep 14 15:17:06 1998 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id PAA01956; Mon, 14 Sep 1998 15:17:01 -0700 (MST) From: Terry Lambert Message-Id: <199809142217.PAA01956@usr05.primenet.com> Subject: Re: Unused functions To: mike@smith.net.au (Mike Smith) Date: Mon, 14 Sep 1998 22:17:00 +0000 (GMT) Cc: tlambert@primenet.com, mike@smith.net.au, graphix@iastate.edu, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199809141819.LAA00296@dingo.cdrom.com> from "Mike Smith" at Sep 14, 98 11:19:48 am 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 > > > It allows the programmer and the C scoping rules to > > > work together to determine what should be associated and what need not. > > > > Instead of the compiler merely calculating hamiltonian cycles in > > the dependency graph to do dead code elimination. > > And if I happen to *want* all of the items in a given object (eg. I am > using a scripting language that supports primitive lookup via the > symbol table, or any other form of lazy runtime linking)? > > The current rules give the best of both worlds. Don't fix what isn't > really broken. Dynamic linking requires dlopen, requires a name-to-table-offset mapping (*not* your standard symbol table mechanism!), and will work, even on stripped executables. Yes, dead-code elimination would be "bad" if you were loading objects that called otherwise dead code in the program address space (ie: used the program symbol space as a library symbol space). In such cases, I suggest you don't use -O2, since the compiler will do dead code elimination on you within modules if it thinks it can get away with it right now. So I think the dynmaic linking case and the static case are two *very* different cases. 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