5.2.3. The __user_libspace static data area

The __user_libspace static data area holds the static data for the C libraries. This is a block of 96 bytes in the ZI segment, supplied by the C library. It is also used as a temporary stack during C library initialization.

The default ARM C libraries use the __user_libspace area to hold:

The C++ libraries use the __user_libspace area to hold:

See the C++ ABI for the ARM Architecture and Exception Handling ABI for the ARM Architecture specifications for more information on __aeabi_atexit(), std::set_terminate() and std::set_unexpected().

Note

How the C and C++ library use the __user_libspace area might change in future releases.

Addressing __user_libspace

Two wrapper functions are provided to return a subsection of the __user_libspace static data area:

__user_perproc_libspace()

Returns a pointer to 96 bytes used to store data that is global to an entire process, that is data shared between all threads.

__user_perthread_libspace()

Returns a pointer to 96 bytes used to store data that is local to a particular thread. This means that __user_perthread_libspace() returns a different address depending on the thread it is called from.

Re-implementing __user_libspace

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 Tailoring static data access for more details).

Where you are porting single-threaded processes to RVCT v2.2 that re-implement this function, you can continue to do this without having to change your code. The change in behavior is, however, important if you are using RVCT to write multithreaded applications.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0205F
Non-Confidential