Specifications

ldw r6, %tls_ldo(x2)(r2) # R_NIOS2_TLS_LDO16 x2
# Value of x2 in r6
One 2-word GOT slot is allocated for all R_NIOS2_TLS_LDM16 operations in the linked object. Any
thread-local symbol in this object can be used, as shown in "GOT Slot with Thread-Local Storage"
example.
Example 7-7: GOT Slot with Thread-Local Storage
GOT[n] R_NIOS2_TLS_DTPMOD x
GOT[n+1] 0
Example 7-8: Initial Exec Model
ldw r4, %tls_ie(x)(r22) # R_NIOS2_TLS_IE16 x
add r4, r23, r4
# Address of x in r4
A single GOT slot is allocated to hold the offset of x from the thread pointer, as shown in "GOT SLot for
Initial Exec Model" example.
Example 7-9: GOT Slot for Initial Exec Model
GOT[n] R_NIOS2_TLS_TPREL x
Example 7-10: Local Exec Model
addi r4, r23, %tls_le(x) # R_NIOS2_TLS_LE16 x
# Address of x in r4
There is no GOT slot associated with the local exec model.
Debug information uses the GNU extension DW_OP_GNU_push_tls_address.
Example 7-11: Debug Information
.byte 0x03 # DW_OP_addr
.word %tls_ldo(x) # R_NIOS2_TLS_DTPREL x
.byte 0xe0 # DW_OP_GNU_push_tls_address
NII51016
2015.04.02
Thread-Local Storage
7-15
Application Binary Interface
Altera Corporation
Send Feedback