2009-09-29 06:18 PM
Size of HEX file generated by GCC is toot large than expected
2011-05-17 12:59 AM
Hi All,
I am using GCC compiler with Anglia IDE. The hex file size generated by GCC is too large than expected. I have checked the MAP file generqated by GCC. GCC has defined addresses for each object file. Also it has defined addresses for each function that is defined in C file. It doesnt check whether it has been called by any function in the application. So the code is generated for all the function that is included in C file. Is there any setting need to be done such that code is generated only for the functions that is used in the application and not for the functions that is not even called by any function. I dont find any configuration in IDE for this. Does anybody know option setting of GCC for this? Please let me know. Thanks and regards Sai2011-05-17 12:59 AM
Make sure the following options are checked in settings:
Split Functions and Split Data - this adds the following gcc options -ffunction-sections -fdata-sections. In the linker make sure you have Enable Garbage Collection enabled - this adds the ld options --gc-sections Cheers sjo2011-05-17 12:59 AM