link

package
v0.0.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FindFuncBucketSize = int(unsafe.Sizeof(findfuncbucket{}))
	PCHeaderSize       = int(unsafe.Sizeof(pcHeader{}))
)

type size

Variables

This section is empty.

Functions

func MakeThreadJITCodeExecutable

func MakeThreadJITCodeExecutable(ptr uintptr, len int)

func Mmap

func Mmap(size int) ([]byte, error)

func MmapData

func MmapData(size int) ([]byte, error)

func Munmap

func Munmap(b []byte) (err error)

func Parse

func Parse(file, pkgPath string) ([]string, error)

func ReadDependPackages

func ReadDependPackages(linker *Linker, files, pkgPaths []string, symbolNames []string, symPtr map[string]uintptr) error

func RegSymbol

func RegSymbol(symPtr map[string]uintptr) error

func RegSymbolWithPath

func RegSymbolWithPath(symPtr map[string]uintptr, path string) error

func RegSymbolWithSo

func RegSymbolWithSo(symPtr map[string]uintptr, path string) error

func RegTypes

func RegTypes(symPtr map[string]uintptr, interfaces ...interface{})

func Serialize

func Serialize(linker *Linker, writer io.Writer) error

func UnresolvedSymbols

func UnresolvedSymbols(linker *Linker, symPtr map[string]uintptr) []string

Types

type CodeModule

type CodeModule struct {
	Syms map[string]uintptr
	// contains filtered or unexported fields
}

func Load

func Load(linker *Linker, symPtr map[string]uintptr) (codeModule *CodeModule, err error)

func (*CodeModule) Unload

func (cm *CodeModule) Unload()

type Linker

type Linker struct {
	LinkerData
	SymMap             map[string]*obj.Sym
	ObjSymbolMap       map[string]*obj.ObjSymbol
	NameMap            map[string]int
	StringMap          map[string]*string
	CgoImportMap       map[string]*obj.CgoImport
	CgoFuncs           map[string]int
	UnImplementedTypes map[string]map[string]int
	Filetab            []uint32
	Pclntable          []byte
	Funcs              []*_func
	Packages           map[string]*obj.Pkg
	Arch               *sys.Arch
	CUOffset           int32
	ExtraData          int
	AdaptedOffset      bool
}

func ReadObj

func ReadObj(file, pkgPath string) (*Linker, error)

func ReadObjs

func ReadObjs(files []string, pkgPaths []string) (*Linker, error)

func UnSerialize

func UnSerialize(reader io.Reader) (*Linker, error)

func (*Linker) AddCgoSymbols

func (linker *Linker) AddCgoSymbols(symPtr map[string]uintptr) error

type LinkerData

type LinkerData struct {
	Code      []byte
	Data      []byte
	Noptrdata []byte
	Bss       []byte
	Noptrbss  []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL