SPRAB89A September 2011 – March 2014
All variables that are not auto or dynamic are considered static data; that is, variables with C storage classes extern or static whose address is established at (static or dynamic) link time. These are allocated into various sections according to their properties and then combined into one or more static data segments.
A data segment designated as a DP-relative segment is addressed using DP-relative addressing. Upon entry to any code in the load module, the DP is initialized to point to a process-private copy of the load module's DP-relative segment with the lowest address. The linker defines the symbol _ _C6000_DSBT_BASE to point to this address.
DP-relative addressing has two forms. Near DP-relative addressing applies when the DP-relative offset can be encoded into a single instruction as a 15-bit unsigned constant. Far DP-relative addressing applies when it cannot, necessitating additional instructions. When a variable is addressed using the near form, its placement is constrained to be within 32 KB of the DP.
DP-relative segments are identified by the PF_C6000_DPREL flag in the program header (see Section 14.2).
Some platforms (Linux, in particular) may constrain load modules to have no more than one DP-relative segment.
Additional data segments containing static variables are referred to as absolute data segments, and are addressed using either absolute or GOT-based addressing. There are no restrictions on their number, size, or placement.
If a program is dynamically linked and has shared libraries, the data segments of each load module are independent from those of other load modules. In particular, each load module has its own data segments, including DP-relative segment(s), and therefore its own DP. If multiple executables share a library, they each get a private copy of that library's data segment(s). The model for managing multiple data segments in the absence of virtual address translation is called the DSBT model; it is described in Section 6.8.