Operating System - HP-UX
1834191 Members
2629 Online
110064 Solutions
New Discussion

aCC 3.39 -AA generating huge object files

 
Konc
Occasional Contributor

aCC 3.39 -AA generating huge object files

We are developping portable software and since having migrated to aCC 3.39 (ANSI compliant with -AA, 64 bits), we observe that the object files produced are much larger (average 3.5 times larger) than on other equivalent platform (for example Solaris 8 with CC). Does anyone have a clue on why and if there is a way to have smaller objects?
Thanks
3 REPLIES 3
Adam J Markiewicz
Trusted Contributor

Re: aCC 3.39 -AA generating huge object files

Few things that come to my mind as a clues to check that can have impact on object size (however it is also likely that you won't make any progress with it). Sorted by the impact on the file size in my opinion:

1. Debug info (the more precise info - the more data to remember for object)

2. Template instantiation system (mayby there is much more instantiated templates in your objects on hp then on Solaris - check the manuals for the compilers).

3. Optimizer - the best examples would be functions inlining, loop unrolling...


Good luck

Adam
I do everything perfectly, except from my mistakes
Konc
Occasional Contributor

Re: aCC 3.39 -AA generating huge object files

Also what we observed is the the object size doubled for the same software and same compiler flags between 3.30 without -AA and 3.39 with -AA.
Steve Steel
Honored Contributor

Re: aCC 3.39 -AA generating huge object files

Hi

These are linker options.

Stripping Symbol Table Information from the Output File with -s and -x
The a.out file created by the linker contains symbol table, relocation, and (if debug options were specified) information used by the debugger. Such information can be used by other commands that work on a.out files, but is not actually necessary to make the file run. ld provides two command line options for removing such information and, thus, reducing the size of executables:

-s
Strips all such information from the file. The executable becomes smaller, but difficult or impossible to use with a symbolic debugger. You can get much the same results by running the strip command on an executable (see strip(1)). In some cases, however, -s rearranges the file to save more space than strip.

-x
Strips only local symbols from the symbol table. It reduces executable file size with only a minimal affect on commands that work with executables. However, using this option may still make the file unusable by a symbolic debugger.

These options can reduce the size of executables dramatically. Note, also, that these options can also be used when generating shared libraries without affecting shareability.

Steve Steel

If you want truly to understand something, try to change it. (Kurt Lewin)