[fpc-pascal]How to shrink the executable size?

Lee, John LeeJ at logica.com
Thu Oct 5 11:58:53 CEST 2000

Afraid I didn't follow early part of thread...Did you look at the linkmap
when you smartlinked to see why size so great? There is a program I
contributed, look_map, in ftp fpc \contrib which will analyse it for you
listing the things included or you can do it manually. I spent some time
looking at size (it is important as we know!). I found that using smartlink
(now default for rel 1.0 & later I believe) and -Xs then upx ing I could get
small go32v2 & win32 programs down to 20K or so, but no smaller. Without
smartlinking or -Xs or upxing even small progs can be huge 150-200K! See the
readme with look_map...BTW I also found that the time to load & run programs
is greater after upxing them, even tho' they appear smaller.  HTH John

-----Original Message-----
From: IoDream [mailto:IoDream at ifrance.com]
Sent: Tuesday, October 03, 2000 10:46
To: fpc-pascal at deadlock.et.tudelft.nl
Subject: Re: [fpc-pascal]How to shrink the executable size?

          Sorry to be a lite late on this topic, but it seems that one
question wasn't answered: how to use PMODE/W instead of CWSDPMI. Here is
the answer (short version here) that "Balogh, Karoly (Charlie/INQ)
<charlie at scene.hu>" sent on the list three months ago.

<<<< Stubify.bat >>>>
exe2coff %1.exe
upx %1 -f -9 --coff
copy /b /y \pp\bin\go32v2\pmodstub.exe+%1 %1.exe
<<<< End of Stubify.bat >>>>

   You can find Exe2Coff and Pmodstub in the DJGPP archives, for example
... it's the binary
... and the sources of pmode/w.

   Don't forget to change the path in the batch file at pmodstub line, and
make sure exe2coff and upx are your the path (on my computer, these files
are in $FPCDIR\bin\go32v2).

   If you want further help, ask for charlie (email above). I would be happy
to post you the exe files by email, just send me the request ;) , I'm
IoDream at ifrance.com.

   Note: this of course only works in 32bits DOS mode, like using FPC or TMT
(or VP).

          Good FreePascal Programming,

----- Original Message -----
From: Sebastian Schuberth <s.schuberth at gmx.net>
To: <fpc-pascal at lists.freepascal.org>
Sent: Saturday, September 30, 2000 2:02 PM
Subject: [fpc-pascal]How to shrink the executable size?

> Hi there,
> unfortunately the link to the mailing list archive seems to be broken,
> so I'm not able to look whether my question has been answered before.
> The size of (DOS-GO32V2) executables still is (even after applying the
> optimizations mentioned in the FAQ) very large, a simple test program
> with a single "ClrScr" and "WriteLn" statement is about 62 KB. When I
> use UPX to compress it, it shrinks to 26 KB, but still the external
> CWSDPMI.EXE is required. Exactly the same source compiles under TMT
> Pascal, which uses the PMODE/W extender and PMWLITE for compression, to
> 25 KB (extender INCLUDED, so no need for an additional external file).
> If
> you guys don't have any other idea how to further shrink FPC's files,
> I'd like to try to use PMODE/W instead of GO32V2 with FPC. Is it
> possible? What steps do I need to take? I already guessed that I need to
> compile to OBJ instead of COFF format. I used the -Anasmobj switch to
> archive this (yes, I have nasm installed properly). Unformtunately the
> linker then complains about some format
> error ... any suggestions how to fix that? And will the resulting
> executable be useable with PMODE/W?
> Thanks in advance!
> --
> Sebastian Schuberth
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Vous avez un site perso ?
2 millions de francs à gagner sur i(france) !
Webmasters : ZE CONCOURS ! http://www.ifrance.com/_reloc/concours.emailif

fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

More information about the fpc-pascal mailing list