This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Statically linked binary way way too big

Denis Vlasenko <> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]