26 lines
631 B
ArmAsm
26 lines
631 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
|
||
|
|
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
|