[fpc-pascal] Why win64 program are considerably bigger in exe size than win 32?

Sven Barth pascaldragon at googlemail.com
Sun Dec 31 11:15:05 CET 2017


Am 31.12.2017 00:19 schrieb "Martok" <listbox at martoks-place.de>:

Am 22.12.2017 um 09:30 schrieb Dennis:
> I am upgrading my program from win 32 to win 64 using the new Lazarus 1.8.
> I discovered my program exe size increased from 6M to 9M.
Just for fun, I wrote a small program to parse Linker Map files and show the
image occupation by source object file (~unit).


Could/would you provide that tool as open source? Does it only work with
PE/COFF or also ELF?


First lesson: FPC's internal linker is *a lot* better than the GNU linker
when
it comes to discarding unused parts. Good job there!
<http://puu.sh/yR3WX/780bcea8f1.png>


Good to know :D

Second lesson: the RTL's system and classes are large, compared to Delphi
(at
least older versions). They can do more as well, so I'll call that a draw.

And now the on-topic part: this compares an "empty" project (Lazarus:
Project->New->Program), compiled for win32 and win64
<http://puu.sh/yR0Qs/6e26a74cc9.png>
As you can see, the win64 image is about a third larger - but not so much
because of the code segments (they end shortly after the cyan "bar" for
typinfo,
before the second occurrence of classes), but more so because of the data
sections following. A lot of that is unwind info (.xdata), I'm afraid I
don't
know what .pdata usually is.


.xdata and .pdata are both used for SEH related data on the non-i386
Windows platforms (x84_64 and ARM as well as the obsolete MIPS and PowerPC
targets).

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20171231/1717caab/attachment.html>


More information about the fpc-pascal mailing list