Altera Nios II User Manual page 171

Hide thumbs Also See for Nios II:
Table of Contents

Advertisement

Chapter 7: Application Binary Interface
ABI for Linux Systems
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]
Example 7–6. Local Dynamic Model
addi
call
addi
# Address of x in r5
ldw
# 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
Example
Example 7–7. GOT Slot with Thread-Local Storage
GOT[n]
GOT[n+1]
Example 7–8. Initial Exec Model
ldw
add
# Address of x in r4
A single GOT slot is allocated to hold the offset of x from the thread pointer, as shown
in
Example
Example 7–9. GOT Slot for Initial Exec Model
GOT[n]
Example 7–10. Local Exec Model
addi
# 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, as
shown in
Example 7–11. Debug Information
.byte 0x03
.word %tls_ldo(x)
.byte 0xe0
February 2014 Altera Corporation
7–5.
r4, r22, %tls_ldm(x)
__tls_get_addr
r5, r2, %tls_ldo(x)
r6, %tls_ldo(x2)(r2)
7–7.
r4, %tls_ie(x)(r22)
r4, r23, r4
7–9.
r4, r23, %tls_le(x)
Example
7–11.
R_NIOS2_TLS_DTPMOD x
R_NIOS2_TLS_DTPREL x
# R_NIOS2_TLS_LDM16 x
# R_NIOS2_CALL26 __tls_get_addr
# R_NIOS2_TLS_LDO16 x
# R_NIOS2_TLS_LDO16 x2
R_NIOS2_TLS_DTPMOD x
0
# R_NIOS2_TLS_IE16 x
R_NIOS2_TLS_TPREL x
# R_NIOS2_TLS_LE16 x
# DW_OP_addr
# R_NIOS2_TLS_DTPREL x
# DW_OP_GNU_push_tls_address
Nios II Processor Reference Handbook
7–13

Advertisement

Table of Contents
loading

Table of Contents