From owner-freebsd-hackers Sun Sep 13 17:09:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA26687 for freebsd-hackers-outgoing; Sun, 13 Sep 1998 17:09:33 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from isua4.iastate.edu (isua4.iastate.edu [129.186.1.204]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA26681 for ; Sun, 13 Sep 1998 17:09:32 -0700 (PDT) (envelope-from graphix@iastate.edu) Received: from localhost (graphix@localhost) by isua4.iastate.edu (8.8.5/8.8.5) with SMTP id TAA28013; Sun, 13 Sep 1998 19:09:16 -0500 (CDT) Message-Id: <199809140009.TAA28013@isua4.iastate.edu> To: Terry Lambert Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Unused functions In-reply-to: Your message of "Sun, 13 Sep 1998 23:17:10 -0000." <199809132317.QAA22419@usr04.primenet.com> Date: Sun, 13 Sep 1998 19:09:16 CDT From: Kent Vander Velden Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >For statically linked images, only the functions that are actually >used are linked in. > >For static linkage, the smalled chunk you can pull in during the >link is one ".o" file from the archive (library). So if you have >one ".o" file that resulted from a ".c" file that implements the >functions "bob" and "superbob", you will get both these functions >code, even if you only call one of them. 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. Nothing can be done to remove the bloat after the executable has been linked? Is this commonly the way its done on other systems as well? I had always assumed that unused functions and data were tosed out. Thanks. --- Kent Vander Velden kent@iastate.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message