This is the mail archive of the
mailing list for the glibc project.
Re: Statically linked binary way way too big
Denis Vlasenko <email@example.com> writes:
> Say that again? It's ok for this program to occupy 400k?
Why is 400k any different than 40k, 4M? It so happens that 400k appear
much to you at the moment. Your views will change.
> This last sentence makes me think that you imply ld does _not_
> discard unused functions from individual object modules.
No. They are all used.
> So it may easily link in module a with functions a1() and a2()
> because program needs a1(), and then link in module b,
> because a2() needs something from it. Despite the fact that a2()
> never called. Can ld do that?
It can, if the module has been compiled with
-ffunction-sections. However, for glibc, this is not an issue, because
no module contains more than one function.