链接程序和库指南

64 位 SPARC: 初始可执行 (Initial Executable, IE)

此代码序列实现线程局部存储的访问模型中介绍的 IE 模型。

表 8–5 64 位 SPARC: 初始可执行的线程局部变量的访问代码

代码序列

初始重定位

符号

# %l7 - initialized to GOT pointer, %g7 - thread pointer



0x00 sethi %hi(@tpoff(x)), %o0

0x04 or    %o0, %lo(@tpoff(x)), %o0

0x08 ldx   [%l7 + %o0], %o0

0x0c add   %g7, %o0, %o0

 

# %o0 - contains address of TLS variable
 

 

R_SPARC_TLS_IE_HI22

R_SPARC_TLS_IE_LO10

R_SPARC_TLS_IE_LD

R_SPARC_TLS_IE_ADD
 

 

x

x

x

x
 

未完成的重定位

符号

GOT[n]
R_SPARC_TLS_TPOFF64
x