Thread View: alt.msdos.programmer
3 messages
3 total messages
Started by Kelvin Klijnsma
Fri, 09 Feb 1996 14:00
Borland C/C++ 4.02 Executable size [possible repost]
Author: Kelvin Klijnsma
Date: Fri, 09 Feb 1996 14:00
Date: Fri, 09 Feb 1996 14:00
34 lines
2101 bytes
2101 bytes
[This message is a repost. My news server seems to have been down on
8-2-1996. I'm sorry if you've already read my previous message. Please
repost any reply you may have sent to my previous message. Thanks!]
Hi,
I really like Borland C++ 4.02 but one thing that's very annoying
(IMHO) is the minimum size of an executable. At the moment I only do
some DOS programming, but even the most simple utility will at least
take about 30K. I know that the compiler links in some startup code
and some necessary libs, but my question is: is there any way of
reducing the size of the executable. For instance, in Borland Pascal
you have smart linking and a simple utility need not be larger than
say 5K.
Please note that I'm used to program in TASM, i.e. I'm used to being
in control of what exactly is linked into the program (I guess that's
really why the minimum size of 30K bothers me :-).
In short:
- How do I reduce the size of compiled C programs for DOS.
(And yes, I am aware of executable compressors).
- I would like a solution that works for all memory models.
(Except tiny model: this model does indeed allow me to
produce smaller executables, but I prefer small model).
I appreciate all solutions, suggestions and pointers!
________________________________________________
|_ _|
(__) Kelvin Klijnsma (__)
(___) K.Klijnsma@net.HCC.nl (___)
(__) http://www.inter.nl.net/hcc/K.Klijnsma (__)
|________________________________________________|
Re: Borland C/C++ 4.02 Executable size [possible repost]
Author: Bruce Arnold
Date: Sun, 11 Feb 1996 06:41
Date: Sun, 11 Feb 1996 06:41
66 lines
3393 bytes
3393 bytes
Kelvin Klijnsma wrote: > I really like Borland C++ 4.02 but one thing that's very annoying > (IMHO) is the minimum size of an executable. At the moment I only do > some DOS programming, but even the most simple utility will at least > take about 30K. I know that the compiler links in some startup code > and some necessary libs, but my question is: is there any way of > reducing the size of the executable. For instance, in Borland Pascal > you have smart linking and a simple utility need not be larger than > say 5K. > Please note that I'm used to program in TASM, i.e. I'm used to being > in control of what exactly is linked into the program (I guess that's > really why the minimum size of 30K bothers me :-). > > In short: > > - How do I reduce the size of compiled C programs for DOS. > (And yes, I am aware of executable compressors). > - I would like a solution that works for all memory models. > (Except tiny model: this model does indeed allow me to > produce smaller executables, but I prefer small model). The following is taken from the Borland 4.51 Readme.txt file. I don't know if is applies to version 4.02. ---------------- NOEHxx Libraries ---------------- Purpose: The NOEHxx libraries eliminates the overhead of exception-handling code in the run-time library for users who don't need it and who do rely on any libraries that require it. How to use: A NOEHxx library must be linked in before the standard runtime library. For command-line tools this can be accomplished by specifying the appropriate NOEHxx library on the BCC command-line, or making it the first library given to TLINK. For the IDE, add the appropriate library to the project using AddNode. To ensure the NOEHxx library is processed before the standard libraries, turn on "Show Runtime Nodes" in the Options|Environment|ProjectView dialog. From the project window you can move the library up and down using the ALT-<arrow> keys. Be sure the NOEHxx library appears before other standard libraries. Note: use NOEHWL.LIB when building DPMI16 programs. What they do: The NOEHxx libraries resolve calls to exception-related compiler helper functions to dummy functions that return appropriate return values. They also restore the pre-exception behavior of operator new to return NULL on out of memory conditions. Non-exception enabled versions of setjmp() and longjmp() are also provided. Limitations: Note: some features introduced in BC4.0 require exception handling. These include the string class, BIDS container classes, the standard OWL libraries, and RTTI. ------ End of reference material. I have used this technique to reduce small programs to 10 K bytes. Good Luck with your compiler. ...Bruce
Re: Borland C/C++ 4.02 Executable size [possible repost]
Author: Norman Bullen
Date: Sun, 11 Feb 1996 16:02
Date: Sun, 11 Feb 1996 16:02
45 lines
2914 bytes
2914 bytes
Kelvin Klijnsma wrote: > > [This message is a repost. My news server seems to have been down on > 8-2-1996. I'm sorry if you've already read my previous message. Please > repost any reply you may have sent to my previous message. Thanks!] > > Hi, > > I really like Borland C++ 4.02 but one thing that's very annoying > (IMHO) is the minimum size of an executable. At the moment I only do > some DOS programming, but even the most simple utility will at least > take about 30K. I know that the compiler links in some startup code > and some necessary libs, but my question is: is there any way of > reducing the size of the executable. For instance, in Borland Pascal > you have smart linking and a simple utility need not be larger than > say 5K. > Please note that I'm used to program in TASM, i.e. I'm used to being > in control of what exactly is linked into the program (I guess that's > really why the minimum size of 30K bothers me :-). > > In short: > > - How do I reduce the size of compiled C programs for DOS. > (And yes, I am aware of executable compressors). > - I would like a solution that works for all memory models. > (Except tiny model: this model does indeed allow me to > produce smaller executables, but I prefer small model). > > I appreciate all solutions, suggestions and pointers! > > ________________________________________________ > |_ _| > (__) Kelvin Klijnsma (__) > (___) K.Klijnsma@net.HCC.nl (___) > (__) http://www.inter.nl.net/hcc/K.Klijnsma (__) > |________________________________________________| Are you looking at the size of the program file on disk or the amount of memory required to load it? If you have debugging options turned on Borland C/C++ will add symbol tables to the program file for use with TDEBUG. It is not unusual for these to be larger than the actual program code. To get rid of the symbol tables either recompile with the debugging options turned off or use the utility TDSTRIP to remove them from your program file. Your tiny model programs are much smaller because the linker cannot put symbol tables in a .COM program file.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads