binary

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ARM64v8_0 = ISA{Major: 8, Minor: 0}
	ARM64v8_3 = ISA{Major: 8, Minor: 3} // PAC (Pointer Authentication)
	ARM64v8_5 = ISA{Major: 8, Minor: 5} // BTI (Branch Target Identification), MTE
)

https://developer.arm.com/documentation/ddi0487/latest

View Source
var (
	X86_64v1 = ISA{Major: 1}
	X86_64v2 = ISA{Major: 2}
	X86_64v3 = ISA{Major: 3}
	X86_64v4 = ISA{Major: 4}
)

https://gitlab.com/x86-psABIs/x86-64-ABI

View Source
var (
	PlatformAll    = Platform{Architecture: ArchAll}
	PlatformX86    = Platform{Architecture: ArchX86}
	PlatformX86_64 = Platform{Architecture: ArchX86_64}
	PlatformAllX86 = Platform{Architecture: ArchAllX86}
	PlatformARM    = Platform{Architecture: ArchARM}
	PlatformARM64  = Platform{Architecture: ArchARM64}
	PlatformAllARM = Platform{Architecture: ArchAllARM}

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

Functions

This section is empty.

Types

type Architecture

type Architecture uint32
const (
	ArchUnknown Architecture = 0
	ArchX86     Architecture = 1 << 0
	ArchX86_64  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 | ArchX86_64
	ArchAllARM = ArchARM | ArchARM64
	ArchAll    = ArchX86 | ArchX86_64 | ArchARM | ArchARM64 | ArchRISCV | ArchPPC64 | ArchMIPS | ArchS390X
)

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 (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