Tool/software: TI C/C++ Compiler
We are using IAR for MSP430 to compile and generated a static library. The sources file, which is a c code of an algorithm(i.e. actually platform independent) and just a bit large but the generated libary should be small as around 30K Bytes as it is we generated the libary for many other platforms. However, when we use IAR for MSP430 to generate the libary, it generates a library of nealy 600K Bytes. so big !
We tried to open the generated .r43 libary with an edit tool, such as a text edit, and find that it contains a lot of below readble compilation info appended to the "real" libary as below, which is the reason why the libary is so big:
Number out of range. Valid range is -32768 (-0x8000) to 65535 (0xFFFF).
File: *****\******\*****\****.c, Line: 11126
Source: CALL #?Subroutine123s*******
There are hundreds of lines of such above readable info repeated(only except the Line number are different) inside the generated .r43 libary, which cause the libary is too big. And meanwhile, it provides a possibility to hack the libary since it contains two much readable info of source ! Actually, the above compilation info has been added into the generated .r43 object file by the icc430.exe is performed and reserved into the .r43 libary by the xar.exe.
Although it is big, but the libary has no problem if we add it into out project and could be work fine. That is, the generated file has no problem to be linked into other projects.
If we remove the readable of above info from the libary using an edit tool and left those , and the size would be reduced to 30KBytes, but the library could not be linked into our proects and the conpilation says the libary "is not a UBROF file", which means that we could not remove those above meanningless compilation info from the libary simply just with an edit tool.
So, how and what might be the compilation option, so that we could exclude those compilation info from the generated .r43 libary?