2.6. 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, such as malloc(), rand(), and strtok()
functions that do not manage a static state, but use static data in a way that is specific to the implementation in the ARM compiler, 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 2.6. They do not use semihosting.
Table 2.6. C library callouts
See also Tailoring the runtime memory model 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. However, if you are writing an operating system or a process switcher, you must re‑implement this function (see Writing reentrant and thread‑safe code).
Note
Exactly which functions use static data in their definitions might change in future releases.