2.3.2. Avoiding C library semihosting

In a standalone application, you are unlikely to support semihosting operations. Therefore, you must be certain that no C library semihosting functions are being linked into your application.

To ensure that no functions that use semihosting are linked in from the C library, you must import the symbol __use_no_semihosting. This can be done in any C or assembler source file in your project as follows:

If functions that use semihosting are still being linked in, the linker reports an error.

To identify these functions, link using the --verbose option. In the resulting output, C library functions are tagged with __I_use_semihosting, for example:

Loading member sys_exit.o from c_a__un.l.
              definition:  _sys_exit
              reference :  __I_use_semihosting

You must provide your own implementations of these functions (_sys_exit in this example).


The linker does not report any semihosting functions in your application code. An error only occurs if this type of function is linked in from the C library.

For a full list of C library functions that use semihosting, see the chapter describing semihosting in RealView Compilation Tools v3.0 Compiler and Libraries Guide.

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0203G