An example of the code for the initial executable TLS code model is shown below:
add:
rd %pc,%o1
sethi %pc22(_GLOBAL_OFFSET_TABLE_-(.L900000106-.)),%g1
add %g1,%pc10(_GLOBAL_OFFSET_TABLE_-(.L900000106-.)),%g1
add %g1,%o1,%o1
sethi %tie_hi22(sum),%o3
add %o3,%tie_lo10(sum),%o2
ldx [%o1+%o2],%g5,%tie_ldx(sum)
add %g7,%g5,%g3,%tie_add(sum)
ld [%g3],%g4
add %g4,%o0,%g2
retl
st %g2,[%g3]Here it takes four instructions to form a pointer to the GOT into register %o1, followed by two instruction to form the offset of the address of sum in the GOT.
The operators act as follows:
|