Documentation
¶
Index ¶
- Constants
- Variables
- type Dependency
- type DependencyReader
- type DependencyRequest
- type Module
- func (module *Module) CallExport(name string) error
- func (module *Module) CallExportWithArgs(name string, args ...uintptr) (uintptr, error)
- func (module *Module) Free()
- func (module *Module) ProcAddressByName(name string) (uintptr, error)
- func (module *Module) ProcAddressByOrdinal(ordinal uint16) (uintptr, error)
Constants ¶
const MaxExportArguments = 3
MaxExportArguments is the maximum number of machine-word arguments accepted by CallExportWithArgs on every supported platform.
Variables ¶
var ErrDependencyNotFound = errors.New("dependency library not found")
ErrDependencyNotFound is returned by a DependencyReader when an imported library cannot be found in any of its configured search locations.
var ErrGoExportArgumentsUnsupported = errors.New("memmod: CallExportWithArgs is not supported for Go c-shared images")
ErrGoExportArgumentsUnsupported reports that CallExportWithArgs was used on a Go c-shared image. Use CallExport for its zero-argument exports instead.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶ added in v0.0.4
Dependency contains the bytes and canonical path of a resolved import.
type DependencyReader ¶ added in v0.0.4
type DependencyReader func(DependencyRequest) (Dependency, error)
DependencyReader resolves and reads an imported application library. Implementations must return the path whose bytes they read so nested relative imports can be resolved from the dependency's own directory. Platform backends may bypass the reader for known native runtime libraries. Returning an error that wraps ErrDependencyNotFound allows a backend to use its native system-library fallback; other errors are terminal.
type DependencyRequest ¶ added in v0.0.4
DependencyRequest describes one shared-library import discovered while a recursive load graph is being built.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func LoadLibrary ¶
func LoadLibraryRecursive ¶ added in v0.0.4
func LoadLibraryRecursive(data []byte, origin string, reader DependencyReader) (_ *Module, retErr error)
LoadLibraryRecursive maps an ELF root and each non-system DT_NEEDED dependency into one private Reflektor load group. The legacy LoadLibrary path intentionally remains separate and continues to resolve dependencies through the process loader.
func (*Module) CallExport ¶
func (*Module) CallExportWithArgs ¶ added in v0.0.4
CallExportWithArgs resolves and calls an exported native C/Rust function with up to MaxExportArguments machine-word arguments and returns the value from the platform's primary return register. Go c-shared callers must use CallExport instead.