Specifications
Expressions in the table above use the following conventions:
• S: Symbol address
• A: Addend
• PC: Program counter
• GP: Global pointer
• Adj(X): (((X >> 16) & 0xFFFF) + ((X >> 15) & 0x1)) & 0xFFFF
• BA: The base address at which a shared library is loaded
• GOT: The value of the Global Offset Table (GOT) pointer (Linux only)
• G: The offset into the GOT for the GOT slot for symbol S (Linux only)
With the information in the table above, any Nios II instruction can be relocated by manipulating it as an
unsigned 32-bit integer, as follows:
Xr = (( R << B ) & M | ( X & ~M ));
where:
• R is the relocated address, calculated in the above table
• B is the bit shift
• M is the bit mask
• X is the original instruction
• Xr is the relocated instruction
Related Information
• Jump Slot Relocation on page 7-14
• Copy Relocation on page 7-14
• Thread-Local Storage on page 7-14
ABI for Linux Systems
This section describes details specific to Linux systems beyond the Linux-specific information in Nios II
ABI Register Usage Table and the Nios II Relocation Calculation Table.
Related Information
• Relocation on page 7-9
• Register Usage on page 7-2
Linux Toolchain Relocation Information
Dynamic relocations can appear in the runtime relocation sections of executables and shared objects, but
never appear in object files (with the exception of R_NIOS2_TLS_DTPREL, which is used for debug
information). No other relocations are dynamic.
Table 7-5: Dynamic Relocations
R_NIOS2_TLS_DTPMOD
R_NIOS2_TLS_DTPREL
R_NIOS2_TLS_TPREL
R_NIOS2_COPY
7-12
ABI for Linux Systems
NII51016
2015.04.02
Altera Corporation
Application Binary Interface
Send Feedback