Overview

Package plan9obj implements access to Plan 9 a.out object files.

Index

file.go

type File

  1. type File struct {
  2. FileHeader
  3. Sections []*
  4. // contains filtered or unexported fields
  5. }

A File represents an open Plan 9 a.out file.

func NewFile

  1. func NewFile(r io.) (*File, )

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.

  1. func Open(name string) (*, error)

Open opens the named file using os.Open and prepares it for use as a Plan 9
a.out binary.

func (*File)

Close closes the File. If the File was created using NewFile directly instead of
Open, Close has no effect.

  1. func (f *) Section(name string) *

Section returns a section with the given name, or nil if no such section exists.

func (*File) Symbols

  1. func (f *File) Symbols() ([], error)

Symbols returns the symbol table for f.

type

  1. Magic
  2. Bss uint32
  3. Entry
  4. PtrSize int
  5. LoadAddress
  6. HdrSize uint64
  7. }

A FileHeader represents a Plan 9 a.out file header.

A Section represents a single section in a Plan 9 a.out file.

  1. func (s *) Data() ([]byte, )

Data reads and returns the contents of the Plan 9 a.out section.

func (*Section) Open

  1. func (s *Section) Open() .ReadSeeker

Open returns a new ReadSeeker reading the Plan 9 a.out section.

type

  1. type SectionHeader struct {
  2. Name
  3. Size uint32
  4. }

A SectionHeader represents a single Plan 9 a.out section header. This structure
doesn’t exist on-disk, but eases navigation through the object file.

type