Executable size affected by module count?
Thomas Kuehne
thomas-dloop at kuehne.cn
Wed Jan 24 14:28:19 PST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
kris schrieb am 2007-01-24:
> Given a (fixed) body of code, it appears that retaining it all within
> one module, and splitting it into multiple modules, results in different
> executable sizes?
>
> There's no real surprise that this would happen, but it's the actual
> difference that is cause for a little concern -- it appears that each
> module consumes 512 bytes minimum. This may actually be a linker thing,
> but perhaps not?
[...]
> Any ideas, Walter?
Every non-trivial module contains (numbers are for Linux)
_D5module7__arrayZ
23 bytes code, 19 bytes stringtab, 18 bytes symtab
_D5module8__assertFiZv
24 bytes code, 23 bytes stringtab, 18 bytes symtab
_D5module9__modctorFZv
11+ bytes code, 23 bytes stringtab, 18 bytes symtab
In total 177 bytes, after stripping (strip --strip-all) 58 bytes.
The minimum overhead of an object file is about 800 bytes,
most of those are discared at link time.
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFt9xsLK5blCcjpWoRAiFWAJ9TP0DUTgcs67gE1XPFwhub90HJlgCfZrxE
cmnrlBB68I2DbBUf61ekwY4=
=czhH
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list