26 lines
634 B
ArmAsm
26 lines
634 B
ArmAsm
#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
|
|
MOVQ handlers+8(SB), AX
|
|
MOVQ AX, ret+0(FP)
|
|
RET
|
|
|
|
// func handler() int64
|
|
TEXT ·handler(SB), NOSPLIT, $0-8
|
|
MOVQ $42, AX
|
|
MOVQ AX, 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, $·handler+5(SB)
|
|
|
|
GLOBL table(SB), RODATA, $8
|
|
DATA table+0(SB)/8, $0x123456789abcdef0
|