Imports #
"internal/buildcfg"
"bytes"
"encoding/binary"
"internal/abi"
"cmd/internal/bio"
"encoding/binary"
"errors"
"fmt"
"unsafe"
"internal/buildcfg"
"bytes"
"encoding/binary"
"internal/abi"
"cmd/internal/bio"
"encoding/binary"
"errors"
"fmt"
"unsafe"
Aux Type
const AuxDwarfInfo
Aux Type
const AuxDwarfLines
Aux Type
const AuxDwarfLoc
Aux Type
const AuxDwarfRanges
Aux Type
const AuxFuncInfo
Aux Type
const AuxFuncdata
Aux Type
const AuxGotype = iota
Aux Type
const AuxPcdata
Aux Type
const AuxPcfile
Aux Type
const AuxPcinline
Aux Type
const AuxPcline
Aux Type
const AuxPcsp
Aux Type
const AuxSehUnwindInfo
const AuxSize = *ast.BinaryExpr
Aux Type
const AuxWasmImport
Aux Type
const AuxWasmType
Blocks
const BlkAutolib = iota
Blocks
const BlkAux
Blocks
const BlkAuxIdx
Blocks
const BlkData
Blocks
const BlkDataIdx
Blocks
const BlkEnd
Blocks
const BlkFile
Blocks
const BlkHash
Blocks
const BlkHash64
Blocks
const BlkHashed64def
Blocks
const BlkHasheddef
Blocks
const BlkNonpkgdef
Blocks
const BlkNonpkgref
Blocks
const BlkPkgIdx
Blocks
const BlkRefFlags
Blocks
const BlkRefName
Blocks
const BlkReloc
Blocks
const BlkRelocIdx
Blocks
const BlkSymdef
const Hash64Size = 8
const HashSize = 16
const Magic = "\x00go120ld"
Blocks
const NBlk
const ObjFlagFromAssembly
const ObjFlagShared = *ast.BinaryExpr
const ObjFlagStd
const ObjFlagUnlinkable
Package Index.
const PkgIdxBuiltin
Package Index.
const PkgIdxHashed
Package Index.
const PkgIdxHashed64
Package Index.
const PkgIdxInvalid = 0
Package Index.
const PkgIdxNone = *ast.BinaryExpr
Package Index.
const PkgIdxSelf
Package Index.
const PkgIdxSpecial = PkgIdxSelf
const RefFlagsSize = *ast.BinaryExpr
const RefNameSize = *ast.BinaryExpr
const RelocSize = *ast.BinaryExpr
const SymABIstatic = *ast.UnaryExpr
Sym.Flag2
const SymFlagABIWrapper
Sym.Flag2
const SymFlagDict
Sym.Flag
const SymFlagDupok = *ast.BinaryExpr
Sym.Flag
const SymFlagGoType
Sym.Flag2
const SymFlagItab
Sym.Flag
const SymFlagLeaf
Sym.Flag2
const SymFlagLinkname
Sym.Flag
const SymFlagLocal
Sym.Flag
const SymFlagNoSplit
Sym.Flag2
const SymFlagPkgInit
Sym.Flag
const SymFlagReflectMethod
Sym.Flag
const SymFlagTypelink
Sym.Flag2
const SymFlagUsedInIface = *ast.BinaryExpr
Sym.Flag2
const SymFlagWasmExport
const SymSize = *ast.BinaryExpr
const _
var builtinMap map[string]int
var builtins = [...]struct{...}{...}
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
const importedPkgSize = *ast.BinaryExpr
const stringRefSize = 8
Aux symbol info. Serialized format: Aux struct { Type uint8 Sym SymRef }
type Aux [AuxSize]byte
CUFileIndex is used to index the filenames that are stored in the per-package/per-CU FileList.
type CUFileIndex uint32
type FingerprintType [8]byte
Hash64
type Hash64Type [Hash64Size]byte
Hash
type HashType [HashSize]byte
Referenced symbol flags. Serialized format: RefFlags struct { Sym symRef Flag uint8 Flag2 uint8 }
type RefFlags [RefFlagsSize]byte
Referenced symbol name. Serialized format: RefName struct { Sym symRef Name string }
type RefName [RefNameSize]byte
Relocation. Serialized format: Reloc struct { Off int32 Siz uint8 Type uint16 Add int64 Sym SymRef }
type Reloc [RelocSize]byte
Symbol definition. Serialized format: Sym struct { Name string ABI uint16 Type uint8 Flag uint8 Flag2 uint8 Siz uint32 Align uint32 }
type Sym [SymSize]byte
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 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
}
File header. TODO: probably no need to export this.
type Header struct {
Magic string
Fingerprint FingerprintType
Flags uint32
Offsets [NBlk]uint32
}
Autolib
type ImportedPkg struct {
Pkg string
Fingerprint FingerprintType
}
InlTreeNode is the serialized form of FileInfo.InlTree.
type InlTreeNode struct {
Parent int32
File CUFileIndex
Line int32
Func SymRef
ParentPC int32
}
type Reader struct {
b []byte
readonly bool
start uint32
h Header
}
Symbol reference.
type SymRef struct {
PkgIdx uint32
SymIdx uint32
}
type Writer struct {
wr *bio.Writer
stringMap map[string]uint32
off uint32
b [8]byte
}
func (s *Sym) ABI() uint16
func (s *Sym) ABIWrapper() bool
func (r *Reloc) Add() int64
func (w *Writer) AddString(s string)
func (s *Sym) Align() uint32
func (r *Reader) Autolib() []ImportedPkg
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 returns the offset of the j-th aux symbol of the i-th symbol.
func (r *Reader) AuxOff(i uint32, j int) uint32
Auxs returns the aux symbols of the i-th symbol.
func (r *Reader) Auxs(i uint32) []Aux
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 returns the name and ABI of the i-th builtin symbol.
func BuiltinName(i int) (string, int)
func (w *Writer) Bytes(s []byte)
func (r *Reader) BytesAt(off uint32, len int) []byte
Data returns the i-th symbol's data.
func (r *Reader) Data(i uint32) []byte
DataOff returns the offset of the i-th symbol's data.
func (r *Reader) DataOff(i uint32) uint32
DataSize returns the size of the i-th symbol's data.
func (r *Reader) DataSize(i uint32) int
DataString returns the i-th symbol's data as a string.
func (r *Reader) DataString(i uint32) string
func (s *Sym) Dupok() bool
func (r *Reader) File(i int) string
func (r *Reader) Fingerprint() FingerprintType
func (r *RefFlags) Flag() uint8
func (s *Sym) Flag() uint8
func (r *RefFlags) Flag2() uint8
func (s *Sym) Flag2() uint8
Flags returns the flag bits read from the object file header.
func (r *Reader) Flags() uint32
func (r *Reader) FromAssembly() bool
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 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
func (s *Sym) IsDict() bool
func (s *Sym) IsGoType() bool
func (s *Sym) IsItab() bool
func (s *Sym) IsLinkname() bool
func (s *Sym) IsPkgInit() bool
func (s SymRef) IsZero() bool
func (fp FingerprintType) IsZero() bool
func (s *Sym) Leaf() bool
func (s *Sym) Local() bool
NAux returns the number of aux symbols of the i-th symbol.
func (r *Reader) NAux(i uint32) int
NBuiltin returns the number of listed builtin symbols.
func NBuiltin() int
func (r *Reader) NFile() int
func (r *Reader) NHashed64def() int
func (r *Reader) NHasheddef() int
func (r *Reader) NNonpkgdef() int
func (r *Reader) NNonpkgref() int
func (r *Reader) NPkg() int
NRefFlags returns the number of referenced symbol flags.
func (r *Reader) NRefFlags() int
NRefName returns the number of referenced symbol names.
func (r *Reader) NRefName() int
NReloc returns the number of relocations of the i-th symbol.
func (r *Reader) NReloc(i uint32) int
func (r *Reader) NSym() int
func (s *Sym) Name(r *Reader) string
func (n *RefName) Name(r *Reader) string
Returns the length of the name of the symbol.
func (s *Sym) NameLen(r *Reader) int
func NewReaderFromBytes(b []byte, readonly bool) *Reader
func NewWriter(wr *bio.Writer) *Writer
func (s *Sym) NoSplit() bool
func (r *Reloc) Off() int32
func (w *Writer) Offset() uint32
func (r *Reader) Pkg(i int) string
func (r *Reader) Pkglist() []string
func (w *Writer) RawString(s string)
func (h *Header) Read(r *Reader) error
Read an InlTreeNode from b, return the remaining bytes.
func (inl *InlTreeNode) Read(b []byte) []byte
func (*FuncInfo) ReadArgs(b []byte) uint32
func (*FuncInfo) ReadFile(b []byte, filesoff uint32, k uint32) CUFileIndex
func (*FuncInfo) ReadFuncFlag(b []byte) abi.FuncFlag
func (*FuncInfo) ReadFuncID(b []byte) abi.FuncID
func (*FuncInfo) ReadFuncInfoLengths(b []byte) FuncInfoLengths
func (*FuncInfo) ReadInlTree(b []byte, inltreeoff uint32, k uint32) InlTreeNode
func (*FuncInfo) ReadLocals(b []byte) uint32
ReadOnly returns whether r.BytesAt returns read-only bytes.
func (r *Reader) ReadOnly() bool
func (*FuncInfo) ReadStartLine(b []byte) int32
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 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
func (s *Sym) ReflectMethod() bool
Reloc returns a pointer to the j-th relocation of the i-th symbol.
func (r *Reader) Reloc(i uint32, j int) *Reloc
RelocOff returns the offset of the j-th relocation of the i-th symbol.
func (r *Reader) RelocOff(i uint32, j int) uint32
Relocs returns a pointer to the relocations of the i-th symbol.
func (r *Reader) Relocs(i uint32) []Reloc
func (r *Reloc) Set(off int32, size uint8, typ uint16, add int64, sym SymRef)
func (s *Sym) SetABI(x uint16)
func (r *Reloc) SetAdd(x int64)
func (s *Sym) SetAlign(x uint32)
func (s *Sym) SetFlag(x uint8)
func (r *RefFlags) SetFlag(x uint8)
func (s *Sym) SetFlag2(x uint8)
func (r *RefFlags) SetFlag2(x uint8)
func (n *RefName) SetName(x string, w *Writer)
func (s *Sym) SetName(x string, w *Writer)
func (r *Reloc) SetOff(x int32)
func (r *Reloc) SetSiz(x uint8)
func (s *Sym) SetSiz(x uint32)
func (r *RefFlags) SetSym(x SymRef)
func (a *Aux) SetSym(x SymRef)
func (r *Reloc) SetSym(x SymRef)
func (n *RefName) SetSym(x SymRef)
func (s *Sym) SetType(x uint8)
func (a *Aux) SetType(x uint8)
func (r *Reloc) SetType(x uint16)
func (r *Reader) Shared() bool
func (r *Reloc) Siz() uint8
func (s *Sym) Siz() uint32
func (h *Header) Size() int
func (r *Reader) Std() bool
func (r *Reader) StringAt(off uint32, len uint32) string
func (w *Writer) StringRef(s string)
func (r *Reader) StringRef(off uint32) string
Sym returns a pointer to the i-th symbol.
func (r *Reader) Sym(i uint32) *Sym
func (a *Aux) Sym() SymRef
func (r *Reloc) Sym() SymRef
func (n *RefName) Sym() SymRef
func (r *RefFlags) Sym() SymRef
SymOff returns the offset of the i-th symbol.
func (r *Reader) SymOff(i uint32) uint32
func (s *Sym) Type() uint8
func (a *Aux) Type() uint8
func (r *Reloc) Type() uint16
func (s *Sym) Typelink() bool
func (w *Writer) Uint16(x uint16)
func (w *Writer) Uint32(x uint32)
func (w *Writer) Uint64(x uint64)
func (w *Writer) Uint8(x uint8)
func (r *Reader) Unlinkable() bool
func (s *Sym) UsedInIface() bool
func (s *Sym) WasmExport() bool
func (r *RefFlags) Write(w *Writer)
func (p *ImportedPkg) Write(w *Writer)
func (a *FuncInfo) Write(w *bytes.Buffer)
func (a *Aux) Write(w *Writer)
func (n *RefName) Write(w *Writer)
func (r *Reloc) Write(w *Writer)
func (inl *InlTreeNode) Write(w *bytes.Buffer)
func (h *Header) Write(w *Writer)
func (s *Sym) Write(w *Writer)
for testing
func (s *Sym) fromBytes(b []byte)
for testing
func (r *Reloc) fromBytes(b []byte)
for testing
func (a *Aux) fromBytes(b []byte)
func init()
func (r *Reader) int32At(off uint32) int32
func (r *Reader) int64At(off uint32) int64
func (w *Writer) stringOff(s string) uint32
func toString(b []byte) string
func (r *Reader) uint16At(off uint32) uint16
func (r *Reader) uint32At(off uint32) uint32
func (r *Reader) uint64At(off uint32) uint64
func (r *Reader) uint8At(off uint32) uint8
Generated with Arrow