goobj

Imports

Imports #

"internal/buildcfg"
"bytes"
"encoding/binary"
"internal/abi"
"cmd/internal/bio"
"encoding/binary"
"errors"
"fmt"
"unsafe"

Constants & Variables

AuxDwarfInfo const #

Aux Type

const AuxDwarfInfo

AuxDwarfLines const #

Aux Type

const AuxDwarfLines

AuxDwarfLoc const #

Aux Type

const AuxDwarfLoc

AuxDwarfRanges const #

Aux Type

const AuxDwarfRanges

AuxFuncInfo const #

Aux Type

const AuxFuncInfo

AuxFuncdata const #

Aux Type

const AuxFuncdata

AuxGotype const #

Aux Type

const AuxGotype = iota

AuxPcdata const #

Aux Type

const AuxPcdata

AuxPcfile const #

Aux Type

const AuxPcfile

AuxPcinline const #

Aux Type

const AuxPcinline

AuxPcline const #

Aux Type

const AuxPcline

AuxPcsp const #

Aux Type

const AuxPcsp

AuxSehUnwindInfo const #

Aux Type

const AuxSehUnwindInfo

AuxSize const #

const AuxSize = *ast.BinaryExpr

AuxWasmImport const #

Aux Type

const AuxWasmImport

AuxWasmType const #

Aux Type

const AuxWasmType

BlkAutolib const #

Blocks

const BlkAutolib = iota

BlkAux const #

Blocks

const BlkAux

BlkAuxIdx const #

Blocks

const BlkAuxIdx

BlkData const #

Blocks

const BlkData

BlkDataIdx const #

Blocks

const BlkDataIdx

BlkEnd const #

Blocks

const BlkEnd

BlkFile const #

Blocks

const BlkFile

BlkHash const #

Blocks

const BlkHash

BlkHash64 const #

Blocks

const BlkHash64

BlkHashed64def const #

Blocks

const BlkHashed64def

BlkHasheddef const #

Blocks

const BlkHasheddef

BlkNonpkgdef const #

Blocks

const BlkNonpkgdef

BlkNonpkgref const #

Blocks

const BlkNonpkgref

BlkPkgIdx const #

Blocks

const BlkPkgIdx

BlkRefFlags const #

Blocks

const BlkRefFlags

BlkRefName const #

Blocks

const BlkRefName

BlkReloc const #

Blocks

const BlkReloc

BlkRelocIdx const #

Blocks

const BlkRelocIdx

BlkSymdef const #

Blocks

const BlkSymdef

Hash64Size const #

const Hash64Size = 8

HashSize const #

const HashSize = 16

Magic const #

const Magic = "\x00go120ld"

NBlk const #

Blocks

const NBlk

ObjFlagFromAssembly const #

const ObjFlagFromAssembly

ObjFlagShared const #

const ObjFlagShared = *ast.BinaryExpr

ObjFlagStd const #

const ObjFlagStd

ObjFlagUnlinkable const #

const ObjFlagUnlinkable

PkgIdxBuiltin const #

Package Index.

const PkgIdxBuiltin

PkgIdxHashed const #

Package Index.

const PkgIdxHashed

PkgIdxHashed64 const #

Package Index.

const PkgIdxHashed64

PkgIdxInvalid const #

Package Index.

const PkgIdxInvalid = 0

PkgIdxNone const #

Package Index.

const PkgIdxNone = *ast.BinaryExpr

PkgIdxSelf const #

Package Index.

const PkgIdxSelf

PkgIdxSpecial const #

Package Index.

const PkgIdxSpecial = PkgIdxSelf

RefFlagsSize const #

const RefFlagsSize = *ast.BinaryExpr

RefNameSize const #

const RefNameSize = *ast.BinaryExpr

RelocSize const #

const RelocSize = *ast.BinaryExpr

SymABIstatic const #

const SymABIstatic = *ast.UnaryExpr

SymFlagABIWrapper const #

Sym.Flag2

const SymFlagABIWrapper

SymFlagDict const #

Sym.Flag2

const SymFlagDict

SymFlagDupok const #

Sym.Flag

const SymFlagDupok = *ast.BinaryExpr

SymFlagGoType const #

Sym.Flag

const SymFlagGoType

SymFlagItab const #

Sym.Flag2

const SymFlagItab

SymFlagLeaf const #

Sym.Flag

const SymFlagLeaf

SymFlagLinkname const #

Sym.Flag2

const SymFlagLinkname

SymFlagLocal const #

Sym.Flag

const SymFlagLocal

SymFlagNoSplit const #

Sym.Flag

const SymFlagNoSplit

SymFlagPkgInit const #

Sym.Flag2

const SymFlagPkgInit

SymFlagReflectMethod const #

Sym.Flag

const SymFlagReflectMethod

SymFlagUsedInIface const #

Sym.Flag2

const SymFlagUsedInIface = *ast.BinaryExpr

SymFlagWasmExport const #

Sym.Flag2

const SymFlagWasmExport

SymSize const #

const SymSize = *ast.BinaryExpr

_ const #

const _

builtinMap var #

var builtinMap map[string]int

builtins var #

var builtins = [...]struct{...}{...}

huge const #

Used to construct an artificially large array type when reading an item from the object file relocs section or aux sym section (needs to work on 32-bit as well as 64-bit). See issue 41621.

const huge = *ast.BinaryExpr

importedPkgSize const #

const importedPkgSize = *ast.BinaryExpr

stringRefSize const #

const stringRefSize = 8

Type Aliases

Aux type #

Aux symbol info. Serialized format: Aux struct { Type uint8 Sym SymRef }

type Aux [AuxSize]byte

CUFileIndex type #

CUFileIndex is used to index the filenames that are stored in the per-package/per-CU FileList.

type CUFileIndex uint32

FingerprintType type #

type FingerprintType [8]byte

Hash64Type type #

Hash64

type Hash64Type [Hash64Size]byte

HashType type #

Hash

type HashType [HashSize]byte

RefFlags type #

Referenced symbol flags. Serialized format: RefFlags struct { Sym symRef Flag uint8 Flag2 uint8 }

type RefFlags [RefFlagsSize]byte

RefName type #

Referenced symbol name. Serialized format: RefName struct { Sym symRef Name string }

type RefName [RefNameSize]byte

Reloc type #

Relocation. Serialized format: Reloc struct { Off int32 Siz uint8 Type uint16 Add int64 Sym SymRef }

type Reloc [RelocSize]byte

Sym type #

Symbol definition. Serialized format: Sym struct { Name string ABI uint16 Type uint8 Flag uint8 Flag2 uint8 Siz uint32 Align uint32 }

type Sym [SymSize]byte

Structs

FuncInfo struct #

FuncInfo is serialized as a symbol (aux symbol). The symbol data is the binary encoding of the struct below.

type FuncInfo struct {
Args uint32
Locals uint32
FuncID abi.FuncID
FuncFlag abi.FuncFlag
StartLine int32
File []CUFileIndex
InlTree []InlTreeNode
}

FuncInfoLengths struct #

FuncInfoLengths is a cache containing a roadmap of offsets and lengths for things within a serialized FuncInfo. Each length field stores the number of items (e.g. files, inltree nodes, etc), and the corresponding "off" field stores the byte offset of the start of the items in question.

type FuncInfoLengths struct {
NumFile uint32
FileOff uint32
NumInlTree uint32
InlTreeOff uint32
Initialized bool
}

ImportedPkg struct #

Autolib

type ImportedPkg struct {
Pkg string
Fingerprint FingerprintType
}

InlTreeNode struct #

InlTreeNode is the serialized form of FileInfo.InlTree.

type InlTreeNode struct {
Parent int32
File CUFileIndex
Line int32
Func SymRef
ParentPC int32
}

Reader struct #

type Reader struct {
b []byte
readonly bool
start uint32
h Header
}

SymRef struct #

Symbol reference.

type SymRef struct {
PkgIdx uint32
SymIdx uint32
}

Writer struct #

type Writer struct {
wr *bio.Writer
stringMap map[string]uint32
off uint32
b [8]byte
}

Functions

ABI method #

func (s *Sym) ABI() uint16

ABIWrapper method #

func (s *Sym) ABIWrapper() bool

Add method #

func (r *Reloc) Add() int64

AddString method #

func (w *Writer) AddString(s string)

Align method #

func (s *Sym) Align() uint32

Autolib method #

func (r *Reader) Autolib() []ImportedPkg

Aux method #

Aux returns a pointer to the j-th aux symbol of the i-th symbol.

func (r *Reader) Aux(i uint32, j int) *Aux

AuxOff method #

AuxOff returns the offset of the j-th aux symbol of the i-th symbol.

func (r *Reader) AuxOff(i uint32, j int) uint32

Auxs method #

Auxs returns the aux symbols of the i-th symbol.

func (r *Reader) Auxs(i uint32) []Aux

BuiltinIdx function #

BuiltinIdx returns the index of the builtin with the given name and abi, or -1 if it is not a builtin.

func BuiltinIdx(name string, abi int) int

BuiltinName function #

BuiltinName returns the name and ABI of the i-th builtin symbol.

func BuiltinName(i int) (string, int)

Bytes method #

func (w *Writer) Bytes(s []byte)

BytesAt method #

func (r *Reader) BytesAt(off uint32, len int) []byte

Data method #

Data returns the i-th symbol's data.

func (r *Reader) Data(i uint32) []byte

DataOff method #

DataOff returns the offset of the i-th symbol's data.

func (r *Reader) DataOff(i uint32) uint32

DataSize method #

DataSize returns the size of the i-th symbol's data.

func (r *Reader) DataSize(i uint32) int

DataString method #

DataString returns the i-th symbol's data as a string.

func (r *Reader) DataString(i uint32) string

Dupok method #

func (s *Sym) Dupok() bool

File method #

func (r *Reader) File(i int) string

Fingerprint method #

func (r *Reader) Fingerprint() FingerprintType

Flag method #

func (r *RefFlags) Flag() uint8

Flag method #

func (s *Sym) Flag() uint8

Flag2 method #

func (r *RefFlags) Flag2() uint8

Flag2 method #

func (s *Sym) Flag2() uint8

Flags method #

Flags returns the flag bits read from the object file header.

func (r *Reader) Flags() uint32

FromAssembly method #

func (r *Reader) FromAssembly() bool

Hash method #

Hash returns a pointer to the i-th hashed symbol's hash. Note: here i is the index of hashed symbols, not all symbols (unlike other accessors).

func (r *Reader) Hash(i uint32) *HashType

Hash64 method #

Hash64 returns the i-th short hashed symbol's hash. Note: here i is the index of short hashed symbols, not all symbols (unlike other accessors).

func (r *Reader) Hash64(i uint32) uint64

IsDict method #

func (s *Sym) IsDict() bool

IsGoType method #

func (s *Sym) IsGoType() bool

IsItab method #

func (s *Sym) IsItab() bool

IsLinkname method #

func (s *Sym) IsLinkname() bool

IsPkgInit method #

func (s *Sym) IsPkgInit() bool

IsZero method #

func (s SymRef) IsZero() bool

IsZero method #

func (fp FingerprintType) IsZero() bool

Leaf method #

func (s *Sym) Leaf() bool

Local method #

func (s *Sym) Local() bool

NAux method #

NAux returns the number of aux symbols of the i-th symbol.

func (r *Reader) NAux(i uint32) int

NBuiltin function #

NBuiltin returns the number of listed builtin symbols.

func NBuiltin() int

NFile method #

func (r *Reader) NFile() int

NHashed64def method #

func (r *Reader) NHashed64def() int

NHasheddef method #

func (r *Reader) NHasheddef() int

NNonpkgdef method #

func (r *Reader) NNonpkgdef() int

NNonpkgref method #

func (r *Reader) NNonpkgref() int

NPkg method #

func (r *Reader) NPkg() int

NRefFlags method #

NRefFlags returns the number of referenced symbol flags.

func (r *Reader) NRefFlags() int

NRefName method #

NRefName returns the number of referenced symbol names.

func (r *Reader) NRefName() int

NReloc method #

NReloc returns the number of relocations of the i-th symbol.

func (r *Reader) NReloc(i uint32) int

NSym method #

func (r *Reader) NSym() int

Name method #

func (s *Sym) Name(r *Reader) string

Name method #

func (n *RefName) Name(r *Reader) string

NameLen method #

Returns the length of the name of the symbol.

func (s *Sym) NameLen(r *Reader) int

NewReaderFromBytes function #

func NewReaderFromBytes(b []byte, readonly bool) *Reader

NewWriter function #

func NewWriter(wr *bio.Writer) *Writer

NoSplit method #

func (s *Sym) NoSplit() bool

Off method #

func (r *Reloc) Off() int32

Offset method #

func (w *Writer) Offset() uint32

Pkg method #

func (r *Reader) Pkg(i int) string

Pkglist method #

func (r *Reader) Pkglist() []string

RawString method #

func (w *Writer) RawString(s string)

Read method #

func (h *Header) Read(r *Reader) error

Read method #

Read an InlTreeNode from b, return the remaining bytes.

func (inl *InlTreeNode) Read(b []byte) []byte

ReadArgs method #

func (*FuncInfo) ReadArgs(b []byte) uint32

ReadFile method #

func (*FuncInfo) ReadFile(b []byte, filesoff uint32, k uint32) CUFileIndex

ReadFuncFlag method #

func (*FuncInfo) ReadFuncFlag(b []byte) abi.FuncFlag

ReadFuncID method #

func (*FuncInfo) ReadFuncID(b []byte) abi.FuncID

ReadFuncInfoLengths method #

func (*FuncInfo) ReadFuncInfoLengths(b []byte) FuncInfoLengths

ReadInlTree method #

func (*FuncInfo) ReadInlTree(b []byte, inltreeoff uint32, k uint32) InlTreeNode

ReadLocals method #

func (*FuncInfo) ReadLocals(b []byte) uint32

ReadOnly method #

ReadOnly returns whether r.BytesAt returns read-only bytes.

func (r *Reader) ReadOnly() bool

ReadStartLine method #

func (*FuncInfo) ReadStartLine(b []byte) int32

RefFlags method #

RefFlags returns a pointer to the i-th referenced symbol flags. Note: here i is not a local symbol index, just a counter.

func (r *Reader) RefFlags(i int) *RefFlags

RefName method #

RefName returns a pointer to the i-th referenced symbol name. Note: here i is not a local symbol index, just a counter.

func (r *Reader) RefName(i int) *RefName

ReflectMethod method #

func (s *Sym) ReflectMethod() bool

Reloc method #

Reloc returns a pointer to the j-th relocation of the i-th symbol.

func (r *Reader) Reloc(i uint32, j int) *Reloc

RelocOff method #

RelocOff returns the offset of the j-th relocation of the i-th symbol.

func (r *Reader) RelocOff(i uint32, j int) uint32

Relocs method #

Relocs returns a pointer to the relocations of the i-th symbol.

func (r *Reader) Relocs(i uint32) []Reloc

Set method #

func (r *Reloc) Set(off int32, size uint8, typ uint16, add int64, sym SymRef)

SetABI method #

func (s *Sym) SetABI(x uint16)

SetAdd method #

func (r *Reloc) SetAdd(x int64)

SetAlign method #

func (s *Sym) SetAlign(x uint32)

SetFlag method #

func (s *Sym) SetFlag(x uint8)

SetFlag method #

func (r *RefFlags) SetFlag(x uint8)

SetFlag2 method #

func (s *Sym) SetFlag2(x uint8)

SetFlag2 method #

func (r *RefFlags) SetFlag2(x uint8)

SetName method #

func (n *RefName) SetName(x string, w *Writer)

SetName method #

func (s *Sym) SetName(x string, w *Writer)

SetOff method #

func (r *Reloc) SetOff(x int32)

SetSiz method #

func (r *Reloc) SetSiz(x uint8)

SetSiz method #

func (s *Sym) SetSiz(x uint32)

SetSym method #

func (r *RefFlags) SetSym(x SymRef)

SetSym method #

func (a *Aux) SetSym(x SymRef)

SetSym method #

func (r *Reloc) SetSym(x SymRef)

SetSym method #

func (n *RefName) SetSym(x SymRef)

SetType method #

func (s *Sym) SetType(x uint8)

SetType method #

func (a *Aux) SetType(x uint8)

SetType method #

func (r *Reloc) SetType(x uint16)

Shared method #

func (r *Reader) Shared() bool

Siz method #

func (r *Reloc) Siz() uint8

Siz method #

func (s *Sym) Siz() uint32

Size method #

func (h *Header) Size() int

Std method #

func (r *Reader) Std() bool

StringAt method #

func (r *Reader) StringAt(off uint32, len uint32) string

StringRef method #

func (w *Writer) StringRef(s string)

StringRef method #

func (r *Reader) StringRef(off uint32) string

Sym method #

Sym returns a pointer to the i-th symbol.

func (r *Reader) Sym(i uint32) *Sym

Sym method #

func (a *Aux) Sym() SymRef

Sym method #

func (r *Reloc) Sym() SymRef

Sym method #

func (n *RefName) Sym() SymRef

Sym method #

func (r *RefFlags) Sym() SymRef

SymOff method #

SymOff returns the offset of the i-th symbol.

func (r *Reader) SymOff(i uint32) uint32

Type method #

func (s *Sym) Type() uint8

Type method #

func (a *Aux) Type() uint8

Type method #

func (r *Reloc) Type() uint16

Uint16 method #

func (w *Writer) Uint16(x uint16)

Uint32 method #

func (w *Writer) Uint32(x uint32)

Uint64 method #

func (w *Writer) Uint64(x uint64)

Uint8 method #

func (w *Writer) Uint8(x uint8)

Unlinkable method #

func (r *Reader) Unlinkable() bool

UsedInIface method #

func (s *Sym) UsedInIface() bool

WasmExport method #

func (s *Sym) WasmExport() bool

Write method #

func (r *RefFlags) Write(w *Writer)

Write method #

func (p *ImportedPkg) Write(w *Writer)

Write method #

func (a *FuncInfo) Write(w *bytes.Buffer)

Write method #

func (a *Aux) Write(w *Writer)

Write method #

func (n *RefName) Write(w *Writer)

Write method #

func (r *Reloc) Write(w *Writer)

Write method #

func (inl *InlTreeNode) Write(w *bytes.Buffer)

Write method #

func (h *Header) Write(w *Writer)

Write method #

func (s *Sym) Write(w *Writer)

fromBytes method #

for testing

func (s *Sym) fromBytes(b []byte)

fromBytes method #

for testing

func (r *Reloc) fromBytes(b []byte)

fromBytes method #

for testing

func (a *Aux) fromBytes(b []byte)

init function #

func init()

int32At method #

func (r *Reader) int32At(off uint32) int32

int64At method #

func (r *Reader) int64At(off uint32) int64

stringOff method #

func (w *Writer) stringOff(s string) uint32

toString function #

func toString(b []byte) string

uint16At method #

func (r *Reader) uint16At(off uint32) uint16

uint32At method #

func (r *Reader) uint32At(off uint32) uint32

uint64At method #

func (r *Reader) uint64At(off uint32) uint64

uint8At method #

func (r *Reader) uint8At(off uint32) uint8

Generated with Arrow