This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Statically linked binary way way too big
- From: martin at v dot loewis dot de (Martin v. Loewis)
- To: vda at port dot imtp dot ilyichevsk dot odessa dot ua
- Cc: libc-alpha at sources dot redhat dot com
- Date: 16 Oct 2002 07:54:44 +0200
- Subject: Re: Statically linked binary way way too big
- References: <200210160532.g9G5Wwp28222@Port.imtp.ilyichevsk.odessa.ua>
Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> writes:
> Based on release announcements ("we don't want
> to hear about size") and discussions with Linus
> seen in archive I know that glibc does not try
> to minimize library size, but nearly half a megabyte
> can never be right.
Why do you say this? How do you determine which size would be right,
and which would not?
> Is there some problems with linker? Does it discard
> all unused sections?
No, and yes.
> Oh, and here is the source code of that program:
>
> int main() {
> return 0;
> }
Did you try to study *why* the image gets that large? Please add
-Wl,--verbose to your compiler options to have the linker print all
object files it incorporates into the executable. If you doubt that
any of these object files rightfully belong into the executable,
please post
a) a complete list of object files that are incorporated into the
executable, and
b) a list of object files that you think should not be there.
If you think that all object files linked into the executable are
needed, but some of them are too large, please post a list of those as
well.
Regards,
Martin