gotools/cmd/splitdwarf/internal/macho/file.go

type File

type FileTOC

func (t *FileTOC) AddLoad(l Load) {}

// AddSegment adds segment s to the file table of contents,
// and also zeroes out the segment information with the expectation
// that this will be added next.
func (t *FileTOC) AddSegment(s *Segment) {}

// Adds section to the most recently added Segment
func (t *FileTOC) AddSection(s *Section) {}

type Load

type LoadBytes

type SegmentHeader

type Segment

func (s *Segment) Put32(b []byte, o binary.ByteOrder) int {}

func (s *Segment) Put64(b []byte, o binary.ByteOrder) int {}

type LoadCmdBytes

type SectionHeader

type Reloc

type Section

func (s *Section) Put32(b []byte, o binary.ByteOrder) int {}

func (s *Section) Put64(b []byte, o binary.ByteOrder) int {}

func (s *Section) PutRelocs(b []byte, o binary.ByteOrder) int {}

func putAtMost16Bytes(b []byte, n string) {}

type Symbol

type FormatError

func formatError(off int64, format string, data ...interface{}

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

func (e *FormatError) String() string {}

// DerivedCopy returns a modified copy of the TOC, with empty loads and sections,
// and with the specified header type and flags.
func (t *FileTOC) DerivedCopy(Type HdrType, Flags HdrFlags) *FileTOC {}

// TOCSize returns the size in bytes of the object file representation
// of the header and Load Commands (including Segments and Sections, but
// not their contents) at the beginning of a Mach-O file.  This typically
// overlaps the text segment in the object file.
func (t *FileTOC) TOCSize() uint32 {}

// LoadAlign returns the required alignment of Load commands in a binary.
// This is used to add padding for necessary alignment.
func (t *FileTOC) LoadAlign() uint64 {}

// SymbolSize returns the size in bytes of a Symbol (Nlist32 or Nlist64)
func (t *FileTOC) SymbolSize() uint32 {}

// HdrSize returns the size in bytes of the Macho header for a given
// magic number (where the magic number has been appropriately byte-swapped).
func (t *FileTOC) HdrSize() uint32 {}

// LoadSize returns the size of all the load commands in a file's table-of contents
// (but not their associated data, e.g., sections and symbol tables)
func (t *FileTOC) LoadSize() uint32 {}

// FileSize returns the size in bytes of the header, load commands, and the
// in-file contents of all the segments and sections included in those
// load commands, accounting for their offsets within the file.
func (t *FileTOC) FileSize() uint64 {}

// Put writes the header and all load commands to buffer, using
// the byte ordering specified in FileTOC t.  For sections, this
// writes the headers that come in-line with the segment Load commands,
// but does not write the reference data for those sections.
func (t *FileTOC) Put(buffer []byte) int {}

// UncompressedSize returns the size of the segment with its sections uncompressed, ignoring
// its offset within the file.  The returned size is rounded up to the power of two in align.
func (s *Segment) UncompressedSize(t *FileTOC, align uint64) uint64 {}

func (s *Section) UncompressedSize() uint64 {}

func (s *Section) PutData(b []byte) {}

func (s *Section) PutUncompressedData(b []byte) {}

func (b LoadBytes) String() string {}

func (b LoadBytes) Raw() []byte                {}

func (b LoadBytes) Copy() LoadBytes            {}

func (b LoadBytes) LoadSize(t *FileTOC) uint32 {}

func (lc LoadCmd) Put(b []byte, o binary.ByteOrder) int {}

func (s LoadCmdBytes) String() string {}

func (s LoadCmdBytes) Copy() LoadCmdBytes {}

func (s *SegmentHeader) String() string {}

func (s *Segment) String() string {}

// Data reads and returns the contents of the segment.
func (s *Segment) Data() ([]byte, error) {}

func (s *Segment) Copy() *Segment {}

func (s *Segment) CopyZeroed() *Segment {}

func (s *Segment) LoadSize(t *FileTOC) uint32 {}

// Open returns a new ReadSeeker reading the segment.
func (s *Segment) Open() io.ReadSeeker {}

// Data reads and returns the contents of the Mach-O section.
func (s *Section) Data() ([]byte, error) {}

func (s *Section) Copy() *Section {}

// Open returns a new ReadSeeker reading the Mach-O section.
func (s *Section) Open() io.ReadSeeker {}

type Dylib

func (s *Dylib) String() string {}

func (s *Dylib) Copy() *Dylib {}

func (s *Dylib) LoadSize(t *FileTOC) uint32 {}

type Dylinker

func (s *Dylinker) String() string {}

func (s *Dylinker) Copy() *Dylinker {}

func (s *Dylinker) LoadSize(t *FileTOC) uint32 {}

type Symtab

func (s *Symtab) Put(b []byte, o binary.ByteOrder) int {}

func (s *Symtab) String() string {}

func (s *Symtab) Copy() *Symtab {}

func (s *Symtab) LoadSize(t *FileTOC) uint32 {}

type LinkEditData

func (s *LinkEditData) String() string {}

func (s *LinkEditData) Copy() *LinkEditData {}

func (s *LinkEditData) LoadSize(t *FileTOC) uint32 {}

type Uuid

func (s *Uuid) String() string {}

func (s *Uuid) Copy() *Uuid {}

func (s *Uuid) LoadSize(t *FileTOC) uint32 {}

func (s *Uuid) Put(b []byte, o binary.ByteOrder) int {}

type DyldInfo

func (s *DyldInfo) String() string {}

func (s *DyldInfo) Copy() *DyldInfo {}

func (s *DyldInfo) LoadSize(t *FileTOC) uint32 {}

type EncryptionInfo

func (s *EncryptionInfo) String() string {}

func (s *EncryptionInfo) Copy() *EncryptionInfo {}

func (s *EncryptionInfo) LoadSize(t *FileTOC) uint32 {}

type Dysymtab

func (s *Dysymtab) String() string {}

func (s *Dysymtab) Copy() *Dysymtab {}

func (s *Dysymtab) LoadSize(t *FileTOC) uint32 {}

type Rpath

func (s *Rpath) String() string   {}

func (s *Rpath) Command() LoadCmd {}

func (s *Rpath) Copy() *Rpath {}

func (s *Rpath) LoadSize(t *FileTOC) uint32 {}

// Open opens the named file using os.Open and prepares it for use as a Mach-O 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 {}

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

func (f *File) parseSymtab(symdat, strtab, cmddat []byte, hdr *SymtabCmd, offset int64) (*Symtab, error) {}

type relocInfo

func (f *File) pushSection(sh *Section, r io.ReaderAt) error {}

func cstring(b []byte) string {}

// Segment returns the first Segment with the given name, or nil if no such segment exists.
func (f *File) Segment(name string) *Segment {}

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

// DWARF returns the DWARF debug information for the Mach-O file.
func (f *File) DWARF() (*dwarf.Data, error) {}

// ImportedSymbols returns the names of all symbols
// referred to by the binary f that are expected to be
// satisfied by other libraries at dynamic load time.
func (f *File) ImportedSymbols() ([]string, error) {}

// ImportedLibraries returns the paths of all libraries
// referred to by the binary f that are expected to be
// linked with the binary at dynamic link time.
func (f *File) ImportedLibraries() ([]string, error) {}

func RoundUp(x, align uint64) uint64 {}