Imports #
"bytes"
"cmd/internal/bio"
"cmd/internal/objabi"
"cmd/internal/sys"
"cmd/link/internal/loader"
"cmd/link/internal/sym"
"encoding/binary"
"fmt"
"bytes"
"cmd/internal/bio"
"cmd/internal/objabi"
"cmd/internal/sys"
"cmd/link/internal/loader"
"cmd/link/internal/sym"
"encoding/binary"
"fmt"
const LdMachoCmdDysymtab = 11const LdMachoCmdSegment = 1const LdMachoCmdSegment64 = 25const LdMachoCmdSymseg = 3const LdMachoCmdSymtab = 2const LdMachoCmdThread = 4const LdMachoCpu386 = 7const LdMachoCpu68000 = 6const LdMachoCpu860 = 15const LdMachoCpu88000 = 13const LdMachoCpu98000 = 10const LdMachoCpuAlpha = 16const LdMachoCpuAmd64 = *ast.BinaryExprconst LdMachoCpuArm = 12const LdMachoCpuArm64 = *ast.BinaryExprconst LdMachoCpuHppa = 11const LdMachoCpuMips = 8const LdMachoCpuPower = 18const LdMachoCpuSparc = 14const LdMachoCpuVax = 1const LdMachoFileCore = 4const LdMachoFileExecutable = 2const LdMachoFileFvmlib = 3const LdMachoFileObject = 1const LdMachoFilePreload = 5TODO(crawshaw): de-duplicate these symbols with cmd/link/internal/ld
const MACHO_ARM64_RELOC_ADDEND = 10TODO(crawshaw): de-duplicate these symbols with cmd/link/internal/ld
const MACHO_X86_64_RELOC_SIGNED = 1TODO(crawshaw): de-duplicate these symbols with cmd/link/internal/ld
const MACHO_X86_64_RELOC_UNSIGNED = 0ldMachoSym.type_
const N_EXT = 0x01ldMachoSym.type_
const N_STAB = 0xe0ldMachoSym.type_
const N_TYPE = 0x1eldMachoSym.desc
const N_WEAK_DEF = 0x80ldMachoSym.desc
const N_WEAK_REF = 0x40type ldMachoCmd struct {
type_ int
off uint32
size uint32
seg ldMachoSeg
sym ldMachoSymtab
dsym ldMachoDysymtab
}type ldMachoDysymtab struct {
ilocalsym uint32
nlocalsym uint32
iextdefsym uint32
nextdefsym uint32
iundefsym uint32
nundefsym uint32
tocoff uint32
ntoc uint32
modtaboff uint32
nmodtab uint32
extrefsymoff uint32
nextrefsyms uint32
indirectsymoff uint32
nindirectsyms uint32
extreloff uint32
nextrel uint32
locreloff uint32
nlocrel uint32
indir []uint32
}type ldMachoObj struct {
f *bio.Reader
base int64
length int64
is64 bool
name string
e binary.ByteOrder
cputype uint
subcputype uint
filetype uint32
flags uint32
cmd []ldMachoCmd
ncmd uint
}type ldMachoRel struct {
addr uint32
symnum uint32
pcrel uint8
length uint8
extrn uint8
type_ uint8
scattered uint8
value uint32
}type ldMachoSect struct {
name string
segname string
addr uint64
size uint64
off uint32
align uint32
reloff uint32
nreloc uint32
flags uint32
res1 uint32
res2 uint32
sym loader.Sym
rel []ldMachoRel
}type ldMachoSeg struct {
name string
vmaddr uint64
vmsize uint64
fileoff uint32
filesz uint32
maxprot uint32
initprot uint32
nsect uint32
flags uint32
sect []ldMachoSect
}type ldMachoSym struct {
name string
type_ uint8
sectnum uint8
desc uint16
kind int8
value uint64
sym loader.Sym
}type ldMachoSymtab struct {
symoff uint32
nsym uint32
stroff uint32
strsize uint32
str []byte
sym []ldMachoSym
}Load the Mach-O file pn from f. Symbols are written into syms, and a slice of the text symbols is returned.
func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, f *bio.Reader, pkg string, length int64, pn string) (textp []loader.Sym, err error)func cstring(x []byte) stringfunc macholoaddsym(m *ldMachoObj, d *ldMachoDysymtab) intfunc macholoadrel(m *ldMachoObj, sect *ldMachoSect) intfunc macholoadsym(m *ldMachoObj, symtab *ldMachoSymtab) intfunc unpackcmd(p []byte, m *ldMachoObj, c *ldMachoCmd, type_ uint, sz uint) intGenerated with Arrow