Executable Sizes

Posted on 1998-06-11
Last Modified: 2011-09-20
certain C programs that iam trying to re-engg use a lot of non-descriptive variable names. for eg:- most int's are 'i', filehandlers are 'fh' etc. what i want to do is give more descriptive variable names. however the catch is that the size of the new executable should not be greater than the previous one. so the question is
"how do the variable names and consequently the size of the symbol table affect the executable size ? Is there any way one can shrink the symbol table?"
i'd appreciate if you can point me to some info about the sym T's.
Question by:rsjetty
  • 3
  • 3

Expert Comment

ID: 1251193
If your original program does not contain
any debug information it will be no difference...

Otherwise you may use strip command to remove
debug info...

Author Comment

ID: 1251194
Thanks dyp.
you have certainly thrown some insight into the problem.
But there are certain issues which i would like to address
(1)i'm not trying to move my executable from a Debug ver. to a Release ver. rather i'm doing code optimisation/enhancements , so at the same time i felt i should make the code more readable.
(2)i'm not familiar with the 'strip' command. what does it do?
if i were to reframe my question i'd put it this way,

how do the statements/declarations
< int ctr; >
< int nCounterToSequentiallyIncrementRelativeStrengthIndex; >
differ from each other when they are loaded in the SymT?

Is there any way I can use lenghty identifiers such as nCounterToSeq... (though i've exaggerated a bit in this example)
in my program and still maintain the SymT or the Executable at the same size as though i were using the identifier 'ctr'.

Expert Comment

ID: 1251195
You should understand that the length of identifiers
will affect the size of the executable only if you
will compile debug info. Otherwise size will not be

strip simple removes all debug information from executable.

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.


Author Comment

ID: 1251196
got you , thanks.
But iam confused with the /H flag supported by the MS compilers.
/H :-Restricts significant characters in external names to a specified length.
also can you be a little more descriptive about 'strip'. ie is it a compiler/linker flag or what.


Accepted Solution

dyp earned 100 total points
ID: 1251197
AFAIK all variables you will use will not be exported.

strip is a command line utility.


Expert Comment

ID: 1251198
dyp has it right, if you are building your executables in release mode (vs. debug mode) you don't need to worry about strip.

Likewise, the /H option mentioned only affects exported function names - and therefore only matters if you are building a DLL.

So- assuming you build in release mode - using "nCounterToSequentiallyIncrementRelativeStrengthIndex" instead of "ctr" will not affect your executable size one byte, both EXEs will be the exact same size.

Author Comment

ID: 1251199
Thanks dpy (& alamo),
I think I've finally got it straight.


Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question