go/src/debug/plan9obj/file.go

type FileHeader

type File

type SectionHeader

type Section

// Data reads and returns the contents of the Plan 9 a.out section.
func (s *Section) Data() ([]byte, error) {}

// Open returns a new ReadSeeker reading the Plan 9 a.out section.
func (s *Section) Open() io.ReadSeeker {}

type Sym

type formatError

func (e *formatError) Error() string {}

// Open opens the named file using [os.Open] and prepares it for use as a Plan 9 a.out binary.
func Open(name string) (*File, error) {}

// Close closes the [File].
// If the [File] was created using [NewFile] directly instead of [Open],
// Close has no effect.
func (f *File) Close() error {}

func parseMagic(magic []byte) (uint32, error) {}

// NewFile creates a new [File] for accessing a Plan 9 binary in an underlying reader.
// The Plan 9 binary is expected to start at position 0 in the ReaderAt.
func NewFile(r io.ReaderAt) (*File, error) {}

func walksymtab(data []byte, ptrsz int, fn func(sym) error) error {}

// newTable decodes the Go symbol table in data,
// returning an in-memory representation.
func newTable(symtab []byte, ptrsz int) ([]Sym, error) {}

var ErrNoSymbols

// Symbols returns the symbol table for f.
func (f *File) Symbols() ([]Sym, error) {}

// Section returns a section with the given name, or nil if no such
// section exists.
func (f *File) Section(name string) *Section {}