loader

package
v0.0.0-...-3423c7d Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package loader implements an ELF loader for the Sealevel virtual machine.

Based on https://docs.rs/solana_rbpf/latest/solana_rbpf/elf_parser/index.html

Index

Constants

View Source
const DT_NUM = 35

DT_NUM is the number of ELF generic dynamic entry types

View Source
const EF_SBF_V2 = 0x20

EF_SBF_V2 is the SBFv2 ELF flag

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader is based on solana_rbpf::elf_parser

func NewLoaderFromBytes

func NewLoaderFromBytes(buf []byte) (*Loader, error)

NewLoaderFromBytes creates an ELF loader from a byte slice.

func (*Loader) Load

func (l *Loader) Load() (*sbf.Program, error)

Load parses, loads, and relocates an SBF program.

This loader differs from rbpf in a few ways: We don't support spec bugs, we relocate after loading.

type R_BPF

type R_BPF int

Relocation types for eBPF.

const (
	R_BPF_NONE        R_BPF = 0
	R_BPF_64_64       R_BPF = 1
	R_BPF_64_RELATIVE R_BPF = 8
	R_BPF_64_32       R_BPF = 10
)

Jump to

Keyboard shortcuts

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