This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Code Bloat using GCC 3.2 on Linux


Hi Gaurav,

Hello,

The help on the options that you suggest indicates "When you specify
these options, the assembler and linker will create larger object and
executable files and will also be slower".

-fdata-sections and -ffunction-sections puts the code in different sections and with the linker flag --gc-sections you can remove code that is never called or data which is never used. This does reduce code size provided the --gc-sections is implemented in the linker. Could you try it on your case and see what happens ?


The reason the object files might be slightly larger is that the encodings chosen for the instructions might be larger because of addressing mode issues, but with --gc-sections and linker relaxations enabled the overall code size would typically be smaller because of possible removal of, code that is never called or data that is never used.

Also 3.2 is no longer supported by the community, so you might not see too much interest in looking at a 3.2 problem. The versions that are supported today are 3.3 and 3.4 . You could try either and see if there are any improvements or they help solve your problem.



Do you have a number of inline functions in your code ? You could try tuning that with -finline-limit-X, where X may be reasonably set to a value between 100 and 5000.

Can you provide a sample testcase where the size difference appears to be huge ?

cheers
Ramana






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]