feat(asm): symbol-valued DATA, division slash in symbols and plain semicolons

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-20 19:15:05 +02:00
parent 289cabe993
commit 6556b85abf
14 changed files with 1027 additions and 18 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "textflag.h"
// The kernel exercises the symbol-valued DATA spelling the runtime's rt0
// files use: a data word holding the address of a symbol, resolved by the
// linker through a relocation at the field.
// func lookup() ptr
TEXT ·lookup(SB), NOSPLIT, $0-8
MOVD handlers+8(SB), R4
MOVD R4, ret+0(FP)
RET
// func handler() int64
TEXT ·handler(SB), NOSPLIT, $0-8
MOVZ $42, R4
MOVD R4, ret+0(FP)
RET
GLOBL handlers(SB), NOPTR, $24
DATA handlers+0(SB)/8, $·handler(SB)
DATA handlers+8(SB)/8, $table(SB)
DATA handlers+16(SB)/8, $extentry(SB)
GLOBL table(SB), RODATA, $8
DATA table+0(SB)/8, $0x123456789abcdef0