mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-23 20:02:22 +00:00
fix: compile error of pkg_amd64.s
fix: compile error of pkg_amd64.s when not include textflag.h and set NOPTR type
This commit is contained in:
parent
d40eb86754
commit
b048d56967
@ -72,7 +72,9 @@ var Id int
|
||||
我们将完整的汇编代码放到pkg_amd64.s文件中:
|
||||
|
||||
```
|
||||
GLOBL ·Id(SB),$8
|
||||
#include "textflag.h"
|
||||
|
||||
GLOBL ·Id(SB),NOPTR,$8
|
||||
|
||||
DATA ·Id+0(SB)/1,$0x37
|
||||
DATA ·Id+1(SB)/1,$0x25
|
||||
@ -98,6 +100,7 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
对于Go包的用户来说,用Go汇编语言或Go语言实现并无任何区别。
|
||||
|
||||
## 3.1.3 定义字符串变量
|
||||
|
Loading…
x
Reference in New Issue
Block a user