# package macho

`import "debug/macho"`

Package macho implements access to Mach-O object files.

fat.go file.go macho.go

## Constants

## Variables

ErrNotFat is returned from NewFatFile or OpenFat when the file is not a universal binary but may be a thin binary, based on its magic number.

## type Cpu

A Cpu is a Mach-O cpu type.

### func (Cpu) GoString

### func (Cpu) String

## type Dylib

A Dylib represents a Mach-O load dynamic library command.

## type DylibCmd

A DylibCmd is a Mach-O load dynamic library command.

## type Dysymtab

A Dysymtab represents a Mach-O dynamic symbol table command.

## type DysymtabCmd

A DysymtabCmd is a Mach-O dynamic symbol table command.

## type FatArch

A FatArch is a Mach-O File inside a FatFile.

## type FatArchHeader

A FatArchHeader represents a fat header for a specific image architecture.

## type FatFile

A FatFile is a Mach-O universal binary that contains at least one architecture.

### func NewFatFile

NewFatFile creates a new FatFile for accessing all the Mach-O images in a universal binary. The Mach-O binary is expected to start at position 0 in the ReaderAt.

### func OpenFat

OpenFat opens the named file using os.Open and prepares it for use as a Mach-O universal binary.

### func (*FatFile) Close

## type File

A File represents an open Mach-O file.

### func NewFile

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 Open

Open opens the named file using os.Open and prepares it for use as a Mach-O binary.

### func (*File) Close

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

### func (*File) DWARF

DWARF returns the DWARF debug information for the Mach-O file.

### func (*File) ImportedLibraries

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 (*File) ImportedSymbols

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 (*File) Section

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

### func (*File) Segment

Segment returns the first Segment with the given name, or nil if no such segment exists.

## type FileHeader

A FileHeader represents a Mach-O file header.

## type FormatError

FormatError is returned by some operations if the data does not have the correct format for an object file.

### func (*FormatError) Error

## type Load

A Load represents any Mach-O load command.

## type LoadBytes

A LoadBytes is the uninterpreted bytes of a Mach-O load command.

### func (LoadBytes) Raw

## type LoadCmd

A LoadCmd is a Mach-O load command.

### func (LoadCmd) GoString

### func (LoadCmd) String

## type Nlist32

An Nlist32 is a Mach-O 32-bit symbol table entry.

## type Nlist64

An Nlist64 is a Mach-O 64-bit symbol table entry.

## type Regs386

Regs386 is the Mach-O 386 register structure.

## type RegsAMD64

RegsAMD64 is the Mach-O AMD64 register structure.

## type Section

### func (*Section) Data

Data reads and returns the contents of the Mach-O section.

### func (*Section) Open

Open returns a new ReadSeeker reading the Mach-O section.

## type Section32

A Section32 is a 32-bit Mach-O section header.

## type Section64

A Section64 is a 64-bit Mach-O section header.

## type SectionHeader

## type Segment

A Segment represents a Mach-O 32-bit or 64-bit load segment command.

### func (*Segment) Data

Data reads and returns the contents of the segment.

### func (*Segment) Open

Open returns a new ReadSeeker reading the segment.

## type Segment32

A Segment32 is a 32-bit Mach-O segment load command.

## type Segment64

A Segment64 is a 64-bit Mach-O segment load command.

## type SegmentHeader

A SegmentHeader is the header for a Mach-O 32-bit or 64-bit load segment command.

## type Symbol

A Symbol is a Mach-O 32-bit or 64-bit symbol table entry.

## type Symtab

A Symtab represents a Mach-O symbol table command.

## type SymtabCmd

A SymtabCmd is a Mach-O symbol table command.

## type Thread

A Thread is a Mach-O thread state command.

## type Type

A Type is the Mach-O file type, e.g. an object file, executable, or dynamic library.