Sign in

username:

password:



Not a member?

Search c6x



Search tips

Subscribe to c6x



c6x by Keywords

AD535 | BIOS | Booting | Bootloader | C621 | C6211 | C6415 | C671 | C6711 | C6711DSK | C6713 | CCS | Chassaing | COFF | DAT | DM64 | DM642 | DMA | DSK671 | DSK6711 | EDM | EDMA | EMIF | Emulator | EVM | EVM620 | FFT | FIR | GPIO | Halting | HPI | HWI | IDK | JTAG | LDB | LDH | LDW | Linker | LMS | LOG_printf | Matlab | McBSP | MEM_alloc | MIPS | PCI | PCM3003 | Pipeline | Profiling | QDM | Reset | ROM | RTDX | Sampling | SDRAM | Stack | TEB | THS1206 | TMS320C621 | TMS320C6416 | TMS320C6711 | TMS320C6713 | UART | Vector Table | XBUS | XDS560


Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | TMS320C6x | reduce the size of .out file when we have some unused functions


Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).

  

Post a new Thread

reduce the size of .out file when we have some unused functions - otag...@yahoo.com - Apr 26 12:00:30 2009

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

_____________________________________

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: reduce the size of .out file when we have some unused functions - William C Bonner - Apr 26 15:53:37 2009

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
>  
>

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: reduce the size of .out file when we have some unused functions - Jeff Brower - Apr 26 19:12:09 2009

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

_____________________________________

______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )