Solved

Executable Sizes

Posted on 1998-06-11
7
227 Views
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.
0
Comment
Question by:rsjetty
  • 3
  • 3
7 Comments
 
LVL 1

Expert Comment

by:dyp
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...
0
 

Author Comment

by:rsjetty
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; >
and
< 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'.
0
 
LVL 1

Expert Comment

by:dyp
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
changed.

strip simple removes all debug information from executable.

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:rsjetty
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.

0
 
LVL 1

Accepted Solution

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

strip is a command line utility.

0
 
LVL 6

Expert Comment

by:alamo
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.
0
 

Author Comment

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

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now