IPR-NIOS Altera, IPR-NIOS Datasheet - Page 177

no-image

IPR-NIOS

Manufacturer Part Number
IPR-NIOS
Description
IP NIOS II MEGACORE RENEW
Manufacturer
Altera
Type
MegaCorer
Datasheet

Specifications of IPR-NIOS

License
Renewal License
Lead Free Status / RoHS Status
Not applicable / Not applicable
Chapter 7: Application Binary Interface
ABI for Linux Systems
December 2010 Altera Corporation
The %hiadj and %lo operators generate PC-relative or non-PC-relative relocations,
depending whether the expression being relocated is PC-relative. For
instance, %hiadj(_gp_got - .) generates R_NIOS2_PCREL_HA. %tls_ldo
generates R_NIOS2_TLS_LDO16 when used as an immediate operand, and
R_NIOS2_TLS_DTPREL when used with the .word directive.
Copy Relocation
The R_NIOS2_COPY relocation is used to mark variables allocated in the executable
that are defined in a shared library. The variable’s initial value is copied from the
shared library to the relocated location.
Jump Slot Relocation
Jump slot relocations are used for the PLT. For information about the PLT, refer to
“Procedure Linkage Table” on page
Thread-Local Storage
The Nios II processor uses the Variant I model for thread-local storage. The end of the
thread control block (TCB) is located 0x7000 bytes before the thread pointer. The TCB
is eight bytes long. The first word is the dynamic thread pointer (DTV) pointer and
the second word is reserved. Each module’s dynamic thread pointer is biased by
0x8000 (when retrieved using __tls_get_addr). The thread library can store
additional private information before the TCB.
In the GNU Linux toolchain, the GOT pointer (_gp_got) is always kept in r22, and the
thread pointer is always kept in r23.
In the following examples, any registers can be used, except that the argument to
__tls_get_addr is always passed in r4 and its return value is always returned in r2.
Calls to __tls_get_addr must use the normal position-independent code (PIC) calling
convention in PIC code; these sequences are for example only, and the compiler might
generate different sequences. No linker relaxations are defined.
Example 7–4
Example 7–4. General Dynamic Model
addi
call
# Address of x in r2
In the general dynamic model, a two-word GOT slot is allocated for x, as shown in
Example
Example 7–5. GOT Slot for General Dynamic Model
GOT[n]
GOT[n+1]
r4, r22, %tls_gd(x)
__tls_get_addr
7–5.
shows the general dynamic model.
7–19.
# R_NIOS2_TLS_GD16 x
# R_NIOS2_CALL26 __tls_get_addr
R_NIOS2_TLS_DTPMOD x
R_NIOS2_TLS_DTPREL x
Nios II Processor Reference Handbook
7–13

Related parts for IPR-NIOS