
Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).
hi all, I have problem with reducing the size of my .out file which is generated by an application project for DM640. the problem is that when a useless library is added to project the size of its .out file increases. say, the linking process is not able to see the unused functions and not add them in the output .out file. how can I configure that project's linking process so that it automatically excludes the unused functions?? thanx ___________________________________________________________________
Generally the linker does exactly what you are requesting when you add a library to the project. I assume that the modern linker acts similar to the linkers that I learned about in college so many years ago. Your source files get compiled into object files. (c or cpp or asm to obj) An archiver may create a library from several object files. (obj to lib) The linker takes many object files and library files and produces a runtime file. (obj and lib to out) The thing about the last step is that the linker would include every obj file that was listed, whether or not it is needed, and search the lib files for any required code to meet the calling requirements. One thing to remember is that the smallest portion of code that the linker can move around is essentially an obj file, and a lib file still has the internal structure of obj files, just repackaged. So if your lib file had all of it's internal obj files being interdependent, then the entire lib file would be included if you included one portion of the lib file. The delineations may become significantly more blurred with modern optimizations such as whole program optimization, where the compiler works on multiple source files to produce it's output. On Sun, Apr 26, 2009 at 5:03 AM, <o...@yahoo.com> wrote: > hi all, > I have problem with reducing the size of my .out file which is generated by > an application project for DM640. the problem is that when a useless library > is added to project the size of its .out file increases. say, the linking > process is not able to see the unused functions and not add them in the > output .out file. how can I configure that project's linking process so that > it automatically excludes the unused functions?? > thanx > >______________________________
Taghizadeh- > I have problem with reducing the size of my .out file which is generated by an application project for DM640. the > problem is that when a useless library is added to project the size of its .out file increases. say, the linking > process is not able to see the unused functions and not add them in the output .out file. how can I configure that > project's linking process so that it automatically excludes the unused functions?? My understanding is that CCS won't link unreachable code. However, if you add "unused" libraries and you have -g or other symbolic debug enabled, then the .out file size may increase due to larger symbol table and more debug info. When you add the unused library, I suggest that you look in your .map file to see whether code size has actually increased, for example see if specific functions inside the unused library are actually listed. My experience has been that unreachable code will not actually show in the .map file. -Jeff ___________________________________________________________________