On Sep 16, 2013, at 03:08, Adrian Chadd <adr...@freebsd.org> wrote:
>> The results are interesting. On amd64:
>> 
>> - devd suddenly becomes 500 KB in size, instead of a megabyte,
>> - init's size drops from 900 KB to 600 KB,
>> - clang becomes a megabyte smaller.
>> 
> 
> .. so, I'd like to know specific information as to why these three are now
> smaller. So what's going on?


This is simply unreferenced code and data being eliminated.  It is quite
normal for libraries (libc, the LLVM libs, etc) to contain functions
that aren't called by the program you are linking.  However, any .o file
with multiple functions in it will be linked in as a whole, even if just
one of the functions is called.

I really think functions and data should always be separately "packaged"
in object files, but for some reason this has never been the default for
GNU tools, and everybody has apparently copied the behavior. :-)

-Dimitry

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to