7.3.6. The C and C++ interworking libraries

Two variants of the Thumb C libraries are provided with the Toolkit:

Use the non-interworking set only if your application consists solely of Thumb code.

Only a non-interworking variant of the ARM C library is provided (armlib.32l and armlib.32b). Interworking versions of the ARM library are not supplied. They are typically of little use, because only ARM routines are likely to call ARM library routines.

For example, it is unlikely that you will want a Thumb routine running from 16-bit memory to use an ARM library routine that takes up more memory and takes longer to execute than the Thumb library equivalent. If you want to build interworking versions of the ARM library, refer to ARM Software Development Toolkit Reference Guide for details of how to rebuild the libraries.

Remember that if interworking takes place within an application, you must use an interworking main library. See Simple rules for interworking.

If you need to select the ARM or Thumb version of a standard C library routine explicitly, or if you want to include both ARM and Thumb versions of a routine, you can force the inclusion of specific modules from a library.

To force inclusion of a library module, put the name of the module in parentheses after the library name. Ensure that there are no spaces between the library name and the opening parenthesis. You can specify more than one module by separating module names with a comma. Ensure that there are no spaces in the list of module names.

Examples

To force the use of the ARM version of strlen() and take all other routines from the interworking Thumb library enter:


armlink -o prog thumb.o arm.o armlib.32l(strlen.o) armlib_i.16l

To force the inclusion of both ARM and Thumb versions of all functions starting with str and take all other routines from the interworking Thumb library enter:


armlink -o prog thumb.o arm.o armlib.16l(str*) armlib.32l(str*) armlib_i.16l

Note

On UNIX platforms, depending on the command shell you are using, you may need to put the characters (, ) and * in quotes in order to enter them on the command line.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential