Documentation
¶
Overview ¶
Package plan9obj implements access to Plan 9 a.out object files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
FileHeader
Sections []*Section
// contains filtered or unexported fields
}
A File represents an open Plan 9 a.out file.
func NewFile ¶
NewFile creates a new File for accessing an Plan 9 binary in an underlying reader. The Plan 9 binary is expected to start at position 0 in the ReaderAt.
func Open ¶
Open opens the named file using os.Open and prepares it for use as an Plan 9 a.out binary.
func (*File) Close ¶
Close closes the File. If the File was created using NewFile directly instead of Open, Close has no effect.
type FileHeader ¶
type FileHeader struct {
Ptrsz int
}
A FileHeader represents an Plan 9 a.out file header.
type FormatError ¶
type FormatError struct {
// contains filtered or unexported fields
}
func (*FormatError) Error ¶
func (e *FormatError) Error() string
type Prog ¶
type Prog struct {
ProgHeader
// Embed ReaderAt for ReadAt method.
// Do not embed SectionReader directly
// to avoid having Read and Seek.
// If a client wants Read and Seek it must use
// Open() to avoid fighting over the seek offset
// with other clients.
io.ReaderAt
// contains filtered or unexported fields
}
A Prog represents the program header in an Plan 9 a.out binary.
func (*Prog) Open ¶
func (p *Prog) Open() io.ReadSeeker
Open returns a new ReadSeeker reading the Plan 9 a.out program body.
type ProgHeader ¶
type ProgHeader struct {
Magic uint32
Text uint32
Data uint32
Bss uint32
Syms uint32
Entry uint64
Spsz uint32
Pcsz uint32
}
A ProgHeader represents a single Plan 9 a.out program header.
type Section ¶
type Section struct {
SectionHeader
// Embed ReaderAt for ReadAt method.
// Do not embed SectionReader directly
// to avoid having Read and Seek.
// If a client wants Read and Seek it must use
// Open() to avoid fighting over the seek offset
// with other clients.
io.ReaderAt
// contains filtered or unexported fields
}
A Section represents a single section in an Plan 9 a.out file.
func (*Section) Open ¶
func (s *Section) Open() io.ReadSeeker
Open returns a new ReadSeeker reading the Plan 9 a.out section.