binary

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ARM64v8_3 = ISA{Major: 8, Minor: 3}
	ARM64v8_5 = ISA{Major: 8, Minor: 5}
)
View Source
var (
	X86_64v1 = ISA{Major: 1}
	X86_64v2 = ISA{Major: 2}
	X86_64v3 = ISA{Major: 3}
	X86_64v4 = ISA{Major: 4}
)
View Source
var (
	PlatformAll    = Platform{Architecture: ArchAll}
	PlatformAllX86 = Platform{Architecture: ArchAllX86}
	PlatformAllARM = Platform{Architecture: ArchAllARM}

	PlatformARM64v8_3 = Platform{Architecture: ArchARM64, MinISA: ARM64v8_3}
	PlatformARM64v8_5 = Platform{Architecture: ArchARM64, MinISA: ARM64v8_5}
)
View Source
var ErrUnsupportedFormat = errors.New("unsupported binary format")

Functions

func ValidArchitectureNames added in v0.3.0

func ValidArchitectureNames() []string

Types

type Architecture

type Architecture uint32
const (
	ArchUnknown Architecture = 0
	ArchX86     Architecture = 1 << 0
	ArchAMD64   Architecture = 1 << 1
	ArchARM     Architecture = 1 << 2
	ArchARM64   Architecture = 1 << 3
	ArchRISCV   Architecture = 1 << 4
	ArchPPC64   Architecture = 1 << 5
	ArchMIPS    Architecture = 1 << 6
	ArchS390X   Architecture = 1 << 7

	ArchAllX86 = ArchX86 | ArchAMD64
	ArchAllARM = ArchARM | ArchARM64
	ArchAll    = ArchX86 | ArchAMD64 | ArchARM | ArchARM64 | ArchRISCV | ArchPPC64 | ArchMIPS | ArchS390X
)

func ParseArchitecture added in v0.3.0

func ParseArchitecture(s string) (Architecture, bool)

func (Architecture) Matches

func (a Architecture) Matches(target Architecture) bool

func (Architecture) String

func (a Architecture) String() string

type Binary

type Binary struct {
	Path         string
	Format       Format
	Architecture Architecture
	Bits         BitWidth
	Build        toolchain.CompilerInfo
	LibC         toolchain.LibC
}

type BitWidth

type BitWidth uint8
const (
	Bits32 BitWidth = 32
	Bits64 BitWidth = 64
)

func (BitWidth) String

func (b BitWidth) String() string

type ELFBinary

type ELFBinary struct {
	Binary
	File       *elf.File
	Symbols    []elf.Symbol
	DynSymbols []elf.Symbol
}

type Format

type Format int
const (
	FormatUnknown Format = iota
	FormatELF
)

func (Format) String

func (f Format) String() string

type ISA

type ISA struct {
	Major int
	Minor int
}

func ParseISA added in v0.3.0

func ParseISA(s string) (ISA, error)

func (ISA) IsAtLeast

func (i ISA) IsAtLeast(required ISA) bool

func (ISA) String

func (i ISA) String() string

type Platform

type Platform struct {
	Architecture Architecture
	MinISA       ISA
}

func (Platform) String

func (p Platform) String() string

Jump to

Keyboard shortcuts

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