package plan9obj

Import Path
	debug/plan9obj (on go.dev)

Dependency Relation
	imports 6 packages, and imported by one package

Involved Source Files Package plan9obj implements access to Plan 9 a.out object files. # Security This package is not designed to be hardened against adversarial inputs, and is outside the scope of https://go.dev/security/policy. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. plan9obj.go
Package-Level Type Names (total 5)
/* sort by: | */
A File represents an open Plan 9 a.out file. FileHeader FileHeader FileHeader.Bss uint32 FileHeader.Entry uint64 FileHeader.HdrSize uint64 FileHeader.LoadAddress uint64 FileHeader.Magic uint32 FileHeader.PtrSize int Sections []*Section Close closes the [File]. If the [File] was created using [NewFile] directly instead of [Open], Close has no effect. Section returns a section with the given name, or nil if no such section exists. Symbols returns the symbol table for f. *File : io.Closer func NewFile(r io.ReaderAt) (*File, error) func Open(name string) (*File, error)
A FileHeader represents a Plan 9 a.out file header. Bss uint32 Entry uint64 HdrSize uint64 LoadAddress uint64 Magic uint32 PtrSize int
A Section represents a single section in a Plan 9 a.out file. 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. SectionHeader SectionHeader SectionHeader.Name string SectionHeader.Offset uint32 SectionHeader.Size uint32 Data reads and returns the contents of the Plan 9 a.out section. Open returns a new ReadSeeker reading the Plan 9 a.out section. ( Section) ReadAt(p []byte, off int64) (n int, err error) Section : io.ReaderAt func (*File).Section(name string) *Section
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. Name string Offset uint32 Size uint32
A Symbol represents an entry in a Plan 9 a.out symbol table section. Name string Type rune Value uint64 func (*File).Symbols() ([]Sym, error)
Package-Level Functions (total 2)
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.
Open opens the named file using [os.Open] and prepares it for use as a Plan 9 a.out binary.
Package-Level Variables (only one)
ErrNoSymbols is returned by [File.Symbols] if there is no such section in the File.
Package-Level Constants (total 4)
const Magic386 = 491
const Magic64 = 32768 // 64-bit expanded header
const MagicAMD64 = 35479
const MagicARM = 1607