• C

Executable Sizes

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.
Who is Participating?
AFAIK all variables you will use will not be exported.

strip is a command line utility.

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...
rsjettyAuthor Commented:
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'.
KuppingerCole Reviews AlgoSec in Executive Report

Leading analyst firm, KuppingerCole reviews AlgoSec's Security Policy Management Solution, and the security challenges faced by companies today in their Executive View report.

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.

rsjettyAuthor Commented:
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.

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.
rsjettyAuthor Commented:
Thanks dpy (& alamo),
I think I've finally got it straight.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.