From owner-freebsd-hackers Mon Sep 14 13:22:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA09494 for freebsd-hackers-outgoing; Mon, 14 Sep 1998 13:22:25 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA09468 for ; Mon, 14 Sep 1998 13:22:20 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id NAA10302; Mon, 14 Sep 1998 13:21:58 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp02.primenet.com, id smtpd010286; Mon Sep 14 13:21:57 1998 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id NAA26933; Mon, 14 Sep 1998 13:21:54 -0700 (MST) From: Terry Lambert Message-Id: <199809142021.NAA26933@usr05.primenet.com> Subject: Re: Unused functions To: graphix@iastate.edu (Kent Vander Velden) Date: Mon, 14 Sep 1998 20:21:54 +0000 (GMT) Cc: tlambert@primenet.com, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199809140009.TAA28013@isua4.iastate.edu> from "Kent Vander Velden" at Sep 13, 98 07:09:16 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 > Just so I completely understand, if I truely use only one function in from > a .o file and no other function is using anything in this .o file, the > entire .o file is still pulled into the executable? So, there are could be > a lot of unused, unreachable code in an executable. Yes, if it's statically linked, and you poorly organize your code. This is why software engineers make more money than mere programmers. > Nothing can be done to remove the bloat after the executable has > been linked? Not quite. But nothing *is* done... > Is this commonly the way its done on other systems as well? Yes. This is a compiler/linker technology issue, not a system issue. > I had always assumed that unused functions and data were tosed out. No. Only for compilers and linkers that optimize for image size and execution speed, instead of for compiler benchmarks. Q: Do you buy a compiler that is very fast, or do you buy the compiler that makes very fast code? 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