We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在分析 golang 启动过程时,经常会提到这么一行 LEAQ runtime·m0+m_tls(SB), DI
LEAQ runtime·m0+m_tls(SB), DI
意思是将m0.tls的地址存入DI寄存器,查看源码时有不少地方用到 m_tls,比如如下:
#ifdef GOOS_windows CMPQ BX, $0 JNE settls MOVQ $0, 0x28(GS) RET settls: MOVQ g_m(BX), AX LEAQ m_tls(AX), AX MOVQ AX, 0x28(GS) #endif get_tls(CX) MOVQ BX, g(CX) RET
我感觉应该也是类似 get_tls (src/runtime/go_tls.h) 这样一个宏,但是翻遍 golang 源码里面好像找不到具体的定义
The text was updated successfully, but these errors were encountered:
这种 runtime 自己的特殊 hack 太多了,这里的 m_tls 编译完成后会变成偏移量,
我猜是链接的时候做的替换:
https://github.com/golang/go/blob/72b6a89ca5cd3c3bfd13b9b17be976e8feb91ecc/src/cmd/internal/objabi/reloctype.go#L68
Sorry, something went wrong.
No branches or pull requests
在分析 golang 启动过程时,经常会提到这么一行
LEAQ runtime·m0+m_tls(SB), DI
意思是将m0.tls的地址存入DI寄存器,查看源码时有不少地方用到 m_tls,比如如下:
我感觉应该也是类似 get_tls (src/runtime/go_tls.h) 这样一个宏,但是翻遍 golang 源码里面好像找不到具体的定义
The text was updated successfully, but these errors were encountered: