go/src/cmd/link/internal/ld/macho.go

type MachoHdr

type MachoSect

type MachoSeg

type MachoPlatformLoad

type MachoLoad

type MachoPlatform

const INITIAL_MACHO_HEADR

const MACHO_CPU_AMD64

const MACHO_CPU_386

const MACHO_SUBCPU_X86

const MACHO_CPU_ARM

const MACHO_SUBCPU_ARM

const MACHO_SUBCPU_ARMV7

const MACHO_CPU_ARM64

const MACHO_SUBCPU_ARM64_ALL

const MACHO_SUBCPU_ARM64_V8

const MACHO_SUBCPU_ARM64E

const MACHO32SYMSIZE

const MACHO64SYMSIZE

const MACHO_X86_64_RELOC_UNSIGNED

const MACHO_X86_64_RELOC_SIGNED

const MACHO_X86_64_RELOC_BRANCH

const MACHO_X86_64_RELOC_GOT_LOAD

const MACHO_X86_64_RELOC_GOT

const MACHO_X86_64_RELOC_SUBTRACTOR

const MACHO_X86_64_RELOC_SIGNED_1

const MACHO_X86_64_RELOC_SIGNED_2

const MACHO_X86_64_RELOC_SIGNED_4

const MACHO_ARM_RELOC_VANILLA

const MACHO_ARM_RELOC_PAIR

const MACHO_ARM_RELOC_SECTDIFF

const MACHO_ARM_RELOC_BR24

const MACHO_ARM64_RELOC_UNSIGNED

const MACHO_ARM64_RELOC_BRANCH26

const MACHO_ARM64_RELOC_PAGE21

const MACHO_ARM64_RELOC_PAGEOFF12

const MACHO_ARM64_RELOC_GOT_LOAD_PAGE21

const MACHO_ARM64_RELOC_GOT_LOAD_PAGEOFF12

const MACHO_ARM64_RELOC_ADDEND

const MACHO_GENERIC_RELOC_VANILLA

const MACHO_FAKE_GOTPCREL

const MH_MAGIC

const MH_MAGIC_64

const MH_OBJECT

const MH_EXECUTE

const MH_NOUNDEFS

const MH_DYLDLINK

const MH_PIE

const S_REGULAR

const S_ZEROFILL

const S_NON_LAZY_SYMBOL_POINTERS

const S_SYMBOL_STUBS

const S_MOD_INIT_FUNC_POINTERS

const S_ATTR_PURE_INSTRUCTIONS

const S_ATTR_DEBUG

const S_ATTR_SOME_INSTRUCTIONS

const PLATFORM_MACOS

const PLATFORM_IOS

const PLATFORM_TVOS

const PLATFORM_WATCHOS

const PLATFORM_BRIDGEOS

const PLATFORM_MACCATALYST

const REBASE_TYPE_POINTER

const REBASE_TYPE_TEXT_ABSOLUTE32

const REBASE_TYPE_TEXT_PCREL32

const REBASE_OPCODE_MASK

const REBASE_IMMEDIATE_MASK

const REBASE_OPCODE_DONE

const REBASE_OPCODE_SET_TYPE_IMM

const REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB

const REBASE_OPCODE_ADD_ADDR_ULEB

const REBASE_OPCODE_ADD_ADDR_IMM_SCALED

const REBASE_OPCODE_DO_REBASE_IMM_TIMES

const REBASE_OPCODE_DO_REBASE_ULEB_TIMES

const REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB

const REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB

const BIND_TYPE_POINTER

const BIND_TYPE_TEXT_ABSOLUTE32

const BIND_TYPE_TEXT_PCREL32

const BIND_SPECIAL_DYLIB_SELF

const BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE

const BIND_SPECIAL_DYLIB_FLAT_LOOKUP

const BIND_SPECIAL_DYLIB_WEAK_LOOKUP

const BIND_OPCODE_MASK

const BIND_IMMEDIATE_MASK

const BIND_OPCODE_DONE

const BIND_OPCODE_SET_DYLIB_ORDINAL_IMM

const BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB

const BIND_OPCODE_SET_DYLIB_SPECIAL_IMM

const BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM

const BIND_OPCODE_SET_TYPE_IMM

const BIND_OPCODE_SET_ADDEND_SLEB

const BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB

const BIND_OPCODE_ADD_ADDR_ULEB

const BIND_OPCODE_DO_BIND

const BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB

const BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED

const BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB

const BIND_OPCODE_THREADED

const BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB

const BIND_SUBOPCODE_THREADED_APPLY

const machoHeaderSize64

var machohdr

var load

var machoPlatform

var seg

var nseg

var ndebug

var nsect

const SymKindLocal

const SymKindExtdef

const SymKindUndef

const NumSymKind

var nkind

var sortsym

var nsortsym

var loadBudget

func getMachoHdr() *MachoHdr {}

// Create a new Mach-O load command. ndata is the number of 32-bit words for
// the data (not including the load command header).
func newMachoLoad(arch *sys.Arch, type_ uint32, ndata uint32) *MachoLoad {}

func newMachoSeg(name string, msect int) *MachoSeg {}

func newMachoSect(seg *MachoSeg, name string, segname string) *MachoSect {}

var dylib

var linkoff

func machowrite(ctxt *Link, arch *sys.Arch, out *OutBuf, linkmode LinkMode) int {}

func (ctxt *Link) domacho() {}

func machoadddynlib(lib string, linkmode LinkMode) {}

func machoshbits(ctxt *Link, mseg *MachoSeg, sect *sym.Section, segname string) {}

func asmbMacho(ctxt *Link) {}

func symkind(ldr *loader.Loader, s loader.Sym) int {}

func collectmachosyms(ctxt *Link) {}

func machosymorder(ctxt *Link) {}

// AddMachoSym adds s to Mach-O symbol table, used in GenSymLate.
// Currently only used on ARM64 when external linking.
func AddMachoSym(ldr *loader.Loader, s loader.Sym) {}

// machoShouldExport reports whether a symbol needs to be exported.
//
// When dynamically linking, all non-local variables and plugin-exported
// symbols need to be exported.
func machoShouldExport(ctxt *Link, ldr *loader.Loader, s loader.Sym) bool {}

func machosymtab(ctxt *Link) {}

func machodysymtab(ctxt *Link, base int64) {}

func doMachoLink(ctxt *Link) int64 {}

func machorelocsect(ctxt *Link, out *OutBuf, sect *sym.Section, syms []loader.Sym) {}

func machoEmitReloc(ctxt *Link) {}

// hostobjMachoPlatform returns the first platform load command found
// in the host object, if any.
func hostobjMachoPlatform(h *Hostobj) (*MachoPlatformLoad, error) {}

// peekMachoPlatform returns the first LC_VERSION_MIN_* or LC_BUILD_VERSION
// load command found in the Mach-O file, if any.
func peekMachoPlatform(m *macho.File) (*MachoPlatformLoad, error) {}

type machoRebaseRecord

var machorebase

func MachoAddRebase(s loader.Sym, off int64) {}

type machoBindRecord

var machobind

func MachoAddBind(off int64, targ loader.Sym) {}

// Generate data for the dynamic linker, used in LC_DYLD_INFO_ONLY load command.
// See mach-o/loader.h, struct dyld_info_command, for the encoding.
// e.g. https://opensource.apple.com/source/xnu/xnu-6153.81.5/EXTERNAL_HEADERS/mach-o/loader.h
func machoDyldInfo(ctxt *Link) {}

// machoCodeSigSym creates and returns a symbol for code signature.
// The symbol context is left as zeros, which will be generated at the end
// (as it depends on the rest of the file).
func machoCodeSigSym(ctxt *Link, codeSize int64) loader.Sym {}

// machoCodeSign code-signs Mach-O file fname with an ad-hoc signature.
// This is used for updating an external linker generated binary.
func machoCodeSign(ctxt *Link, fname string) error {}