Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Sep 1998 19:09:16 CDT
From:      Kent Vander Velden <graphix@iastate.edu>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Unused functions 
Message-ID:  <199809140009.TAA28013@isua4.iastate.edu>
In-Reply-To: Your message of "Sun, 13 Sep 1998 23:17:10 -0000." <199809132317.QAA22419@usr04.primenet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809140009.TAA28013>