Mail Archives: djgpp/1997/10/19/06:18:08
In article <Pine DOT SUN DOT 3 DOT 91 DOT 971014133514 DOT 14821B-100000 AT is>, Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> writes:
>No, it probably means that the options you set in RHIDE somehow don't get
>to gcc. I don't use RHIDE, so I won't know why that might happen, but it
>seems like the simplest explanation to everything you report.
>
>Just to make sure that I'm right, try compiling your program from the DOS
>prompt and see if -O3 and -s (lower-case) have any effect on the size of
>the .exe file. They should.
[snip]
Well, this thread is interesting even if it is overkill to worry so much
about little programs. Just for the sake of curiousity, I followed up on
your suggestions and also got together some info on the type of results I
got with different switches & options. The code I used is at the bottom
(and yes, it is unrealistically simple, but yes, I do use the resulting .exe!)
================================
Before each test, the c80.exe and c80.o files were
deleted.
From RHIDE1.4
no switches: 102,166
-O3 compiler option: 102,040
-O2 compiler option: 102,040
-O3 compiler +
-s linker options: 45,568
-O2 compiler +
-s linker options: 45,568
After running the djp compressor on the 46K
file, it was 28,864 bytes in size.
From the command line:
gcc c80.cc -O2 -s -o c80.exe
...resulted in a 45,568 byte .exe file, as did
gcc -o c80.exe -O3 -s c80.cc
(My first time using the command line, so might
not be right.)
===============================
/*
The point of this prog is to set the textmode to
C80 format. textmode() is in conio.h.
*/
#include <conio.h>
#include <crt0.h>
int main()
{
textmode(C80);
return 0;
}
/* The three following functions are supposed to turn
off some of the overhead code (for dealing with
command line arguments, etc. If I did it right!)
*/
__crt0_glob_function()
{
return 0;
}
__crt0_load_environment_file()
{
return 0;
}
__crt0_setup_arguments_function()
{
return 0;
}
- Raw text -