如何跨preT段寄存器X86-64上访问? [英] How to interpret segment register accesses on x86-64?
问题描述
通过这个功能:
mov 1069833(%rip),%rax # 0x2b5c1bf9ef90 <_fini+3250648>
add %fs:0x0,%rax
retq
我如何跨preT第二个指令,并找出加入RAX?
How do I interpret the second instruction and find out what was added to RAX?
推荐答案
这code:
mov 1069833(%rip),%rax # 0x2b5c1bf9ef90 <_fini+3250648>
add %fs:0x0,%rax
retq
函数返回一个线程局部变量的地址。 %FS:为0x0
是TCB的地址(线程控制块),而 1069833(%RIP)
是偏移从有到变量,这被称为自变量所在无论是在程序或者在程序加载时(通过的dlopen在运行时加载库()
加载一些动态库需要一些不同的code)。
is returning the address of a thread-local variable. %fs:0x0
is the address of the TCB (Thread Control Block), and 1069833(%rip)
is the offset from there to the variable, which is known since the variable resides either in the program or on some dynamic library loaded at program's load time (libraries loaded at runtime via dlopen()
need some different code).
这是非常详细的乌尔里希Drepper的 TLS文件,特别是第4.3节和§4.3.6。
This is explained in great detail in Ulrich Drepper's TLS document, specially §4.3 and §4.3.6.
这篇关于如何跨preT段寄存器X86-64上访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!