tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Trivial program size inflation
Le Fri, Jun 30, 2023 at 01:37:10PM -0400, Mouse a écrit :
> Based on something at work, I was looking at executable sizes. I
> eventually tried a program stripped about as far down as I could:
>
> int main(void);
> int main(void)
> {
> return(0);
> }
>
> and built it -static. size on the resulting binary:
>
> sparc, my mutant 1.4T:
>
> text data bss dec hex filename
> 12616 124 288 13028 32e4 main
>
> amd64, my mutant 5.2:
>
> text data bss dec hex filename
> 152613 4416 16792 173821 2a6fd main
>
> amd64, 9.0_STABLE (ftp.n.o):
>
> text data bss dec hex filename
> 562318 29064 2176416 2767798 2a3bb6 main
>
> 12K to do nothing is bad enough (I'm going to be looking at why it's
> that big). 149K is even more disturbing (I'll be looking at that too).
> But over half a meg of text and two megs of BSS? To do nothing?
> Surely something is wrong somewhere.
What are the compiler (especially the linker) and compiler version on
your 1.4T vs. 9.0?
Having the obligation to support a myriad of systems for kerTeX, I have
seen that, unfortunately, static linking is considered nowadays a second
rate feature if not a deprecated one, and this is a part I have to
adjust from time to time, generally for Linuces, to obtain static binaries.
Other thing to look at: the so called i18n. On NetBSD, iconv doesn't
work with static linking, but could it be that its object are
nonetheless added too? As well as threading and so on?
--
Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
http://www.kergis.com/
http://kertex.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C
Home |
Main Index |
Thread Index |
Old Index