Modifying A Library Function - Texas Instruments TMS320C2x User Manual

Optimizing c compiler digital signal processor
Hide thumbs Also See for TMS320C2x:
Table of Contents

Advertisement

7.1.2

Modifying a Library Function

7.1.3
Building a Library With Different Options
You can inspect or modify library functions by using the archiver to extract the
appropriate source file or files from the source libraries. For example, the fol-
lowing command extracts two source files:
dspar −x rts.src atoi.c strcpy.c
To modify a function, extract the source as in the previous example. Make the
required changes to the code, recompile, and then reinstall the new object file
or files into the library:
dspar −r rts25.lib atoi.obj strcpy.obj
You can also build a new library this way, rather than rebuilding back into
rts25.lib. For more information about the archiver, see the TMS320C1x/C2x/
C2xx/C5x Assembly Language Tools User's Guide.
You can create a new library from rts.src by using the library-build utility,
dspmk. For example, use this command to build a short, optimized run-time-
support library:
dspmk − −u −o2 −x −ms rts.src −l rtsf.lib
The −−u option tells the dspmk utility to use the header files in the current direc-
tory, rather than extracting them from the source archive. The use of the
optimizer (−o2) and inline function expansion (−x) options does not affect com-
patibility with code compiled with these options. The −ms option tells the com-
piler to ignore code speed and generate the shortest possible code.
For more information on the library-build utility, see Chapter 8.
Run-Time-Support Functions
Libraries
7-3

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C2x and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Tms320c2xxTms320c5x

Table of Contents