docs(asm): correct the reference against the assemblers' behaviour
Assisted-by: GLM 5.3
This commit is contained in:
+12
-8
@@ -34,9 +34,9 @@ TEXT symbol(SB), [flags,] $framesize[-argsize]
|
|||||||
(0x80000000 in the object, the value of `ArgsSizeUnknown` from
|
(0x80000000 in the object, the value of `ArgsSizeUnknown` from
|
||||||
`funcdata.h`); a frame size may be negative only in the generated ABI
|
`funcdata.h`); a frame size may be negative only in the generated ABI
|
||||||
wrappers.
|
wrappers.
|
||||||
- A function whose last instruction is not a branch cannot fall through into
|
- A function whose last instruction is not a branch falls through into
|
||||||
the next TEXT: the toolchain appends a jump to itself, so end functions
|
whatever follows: nothing is appended, the next TEXT's code simply
|
||||||
with `RET` deliberately.
|
continues the stream, so end functions with `RET` deliberately.
|
||||||
- One TEXT per symbol; redeclaring is an error. The TEXT line also fixes the
|
- One TEXT per symbol; redeclaring is an error. The TEXT line also fixes the
|
||||||
function's source line for traceback: it is the line number that pcln
|
function's source line for traceback: it is the line number that pcln
|
||||||
reports for the function's start.
|
reports for the function's start.
|
||||||
@@ -59,7 +59,7 @@ Values from `textflag.h`, in agreement with `cmd/internal/obj/textflag.go`:
|
|||||||
| WRAPPER | 32 | TEXT | a wrapper; must not disable `recover` |
|
| WRAPPER | 32 | TEXT | a wrapper; must not disable `recover` |
|
||||||
| NEEDCTXT | 64 | TEXT | a closure consuming the context register |
|
| NEEDCTXT | 64 | TEXT | a closure consuming the context register |
|
||||||
| TLSBSS | 256 | data | a thread local word in BSS |
|
| TLSBSS | 256 | data | a thread local word in BSS |
|
||||||
| NOFRAME | 512 | TEXT | no frame setup; only valid with a frame size of 0 |
|
| NOFRAME | 512 | TEXT | no frame setup; the zero-frame spelling (the toolchain accepts a positive frame beside it and still allocates the frame, and the arm64 BSD syscall stubs pair it with $-8 deliberately) |
|
||||||
| REFLECTMETHOD | 1024 | TEXT | the function calls `reflect.Type.Method` or `MethodByName` |
|
| REFLECTMETHOD | 1024 | TEXT | the function calls `reflect.Type.Method` or `MethodByName` |
|
||||||
| TOPFRAME | 2048 | TEXT | the outermost frame; unwinders stop here |
|
| TOPFRAME | 2048 | TEXT | the outermost frame; unwinders stop here |
|
||||||
| ABIWRAPPER | 4096 | TEXT | an ABI transition wrapper |
|
| ABIWRAPPER | 4096 | TEXT | an ABI transition wrapper |
|
||||||
@@ -89,11 +89,15 @@ GLOBL ·msg(SB), RODATA, $14
|
|||||||
DATA symbol+offset(SB)/width, value
|
DATA symbol+offset(SB)/width, value
|
||||||
```
|
```
|
||||||
|
|
||||||
- `width` is exactly 1, 2, 4 or 8: the initialiser is written into the data
|
- `width` is bound by the value it carries: exactly 1, 2, 4 or 8 for an
|
||||||
image at `symbol+offset` in that many bytes.
|
integer (the assembler rejects any other), 4 or 8 for a float, and any
|
||||||
|
width for a string. The initialiser is written into the data image at
|
||||||
|
`symbol+offset` in that many bytes.
|
||||||
- The value is an integer or character constant of the width, or a string
|
- The value is an integer or character constant of the width, or a string
|
||||||
literal whose byte length equals the width exactly; escapes count. Long
|
literal whose bytes fit the width: a shorter literal is zero-padded, a
|
||||||
data is written as successive DATA lines at increasing offsets; bytes the
|
longer one is rejected; escapes count. An integer wider than the field is
|
||||||
|
silently truncated to the low bytes by both assemblers. Long data is
|
||||||
|
written as successive DATA lines at increasing offsets; bytes the
|
||||||
directives never name are zero.
|
directives never name are zero.
|
||||||
- Every symbol initialised with DATA ends with a GLOBL line declaring its
|
- Every symbol initialised with DATA ends with a GLOBL line declaring its
|
||||||
total size, after all of its DATA lines.
|
total size, after all of its DATA lines.
|
||||||
|
|||||||
Reference in New Issue
Block a user