Datasheet
The C and C++ Libraries
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-25
4.5 Tailoring static data access
This section describes using callouts from the C library to access static data. C library
functions that use static data can be categorized as follows:
• functions that do not use any static data of any kind, for example
fprintf()
• functions that manage a static state, for example
malloc()
,
rand()
, and
strtok()
• functions that do not manage a static state, but use static data in a way that is
specific to their ARM implementation, for example
isalpha()
.
When the C library does something that requires implicit static data, it uses a callout to
a function you can replace. These functions are shown in Table 4-5.
The functions above do not use semihosting.
See also Tailoring the runtime memory model on page 4-67 for more information about
memory use.
The default implementation of
__user_libspace()
creates a 96-byte block in the ZI
segment. Even if your application does not have a
main()
function, the
__user_libspace()
function does not normally have to be redefined. (If you are writing
an operating system or a process switcher, however, you must retarget this function.)
Caution
The number of functions that use static data in their definitions might change in future
versions of ADS.
Table 4-5 Callouts
Function Description
__rt_errno_addr()
Called to get the address of the variable
errno
. See
__rt_errno_addr() on page 4-53.
__rt_fp_status_addr()
Called by the floating-point support code to get the
address of the floating-point status word. See
__rt_fp_status_addr() on page 4-56.
The
locale
functions The function
__user_libspace()
creates a block of private
static data for the library. See Tailoring locale and CTYPE
on page 4-26.