[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Executable Sizes

Posted on 1998-06-11
7
Medium Priority
?
240 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
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 and use switch statements in the C programming language.
Suggested Courses

834 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