package goobj2
import "cmd/internal/goobj2"
Index ¶
- Constants
- func BuiltinIdx(name string, abi int) int
- func BuiltinName(i int) (string, int)
- func NBuiltin() int
- type Aux
- type FuncInfo
- type Header
- func (h *Header) Read(r *Reader) error
- func (h *Header) Size() int
- func (h *Header) Write(w *Writer)
- type InlTreeNode
- type Reader
- func NewReaderFromBytes(b []byte, readonly bool) *Reader
- func (r *Reader) Autolib() []string
- func (r *Reader) AuxOff(i int, j int) uint32
- func (r *Reader) BytesAt(off uint32, len int) []byte
- func (r *Reader) Data(i int) []byte
- func (r *Reader) DataOff(i int) uint32
- func (r *Reader) DataSize(i int) int
- func (r *Reader) DwarfFile(i int) string
- func (r *Reader) Flags() uint32
- func (r *Reader) NAux(i int) int
- func (r *Reader) NDwarfFile() int
- func (r *Reader) NNonpkgdef() int
- func (r *Reader) NNonpkgref() int
- func (r *Reader) NPkg() int
- func (r *Reader) NReloc(i int) int
- func (r *Reader) NSym() int
- func (r *Reader) PcdataBase() uint32
- func (r *Reader) Pkg(i int) string
- func (r *Reader) Pkglist() []string
- func (r *Reader) ReadOnly() bool
- func (r *Reader) RelocOff(i int, j int) uint32
- func (r *Reader) StringAt(off uint32) string
- func (r *Reader) StringRef(off uint32) string
- func (r *Reader) SymOff(i int) uint32
- type Reloc
- func (o *Reloc) Read(r *Reader, off uint32)
- func (r *Reloc) Size() int
- func (r *Reloc) Write(w *Writer)
- type Sym
- func (s *Sym) CFunc() bool
- func (s *Sym) Dupok() bool
- func (s *Sym) IsGoType() bool
- func (s *Sym) Leaf() bool
- func (s *Sym) Local() bool
- func (s *Sym) Read(r *Reader, off uint32)
- func (s *Sym) ReflectMethod() bool
- func (s *Sym) Size() int
- func (s *Sym) TopFrame() bool
- func (s *Sym) Typelink() bool
- func (s *Sym) Write(w *Writer)
- type SymRef
- func (s *SymRef) Read(r *Reader, off uint32)
- func (s *SymRef) Size() int
- func (s *SymRef) Write(w *Writer)
- type Writer
- func NewWriter(wr *bio.Writer) *Writer
- func (w *Writer) AddString(s string)
- func (w *Writer) Bytes(s []byte)
- func (w *Writer) Offset() uint32
- func (w *Writer) RawString(s string)
- func (w *Writer) StringRef(s string)
- func (w *Writer) Uint16(x uint16)
- func (w *Writer) Uint32(x uint32)
- func (w *Writer) Uint64(x uint64)
- func (w *Writer) Uint8(x uint8)
Constants ¶
const ( PkgIdxNone = (1<<31 - 1) - iota // Non-package symbols PkgIdxBuiltin // Predefined symbols // TODO: not used for now, we could use it for compiler-generated symbols like runtime.newobject PkgIdxSelf // Symbols defined in the current package PkgIdxInvalid = 0 )
Package Index.
const ( BlkAutolib = iota BlkPkgIdx BlkDwarfFile BlkSymdef BlkNonpkgdef BlkNonpkgref BlkRelocIdx BlkAuxIdx BlkDataIdx BlkReloc BlkAux BlkData BlkPcdata NBlk )
Blocks
const ( SymFlagDupok = 1 << iota SymFlagLocal SymFlagTypelink SymFlagLeaf SymFlagCFunc SymFlagReflectMethod SymFlagGoType SymFlagTopFrame )
const ( AuxGotype = iota AuxFuncInfo AuxFuncdata AuxDwarfInfo AuxDwarfLoc AuxDwarfRanges AuxDwarfLines )
Aux Type
const Magic = "\x00go114LD"
const ( iota )= 1 <<
const SymABIstatic = ^uint16(0)
Functions ¶
func BuiltinIdx ¶
BuiltinIdx returns the index of the builtin with the given name and abi, or -1 if it is not a builtin.
func BuiltinName ¶
BuiltinName returns the name and ABI of the i-th builtin symbol.
func NBuiltin ¶
func NBuiltin() int
NBuiltin returns the number of listed builtin symbols.
Types ¶
type Aux ¶
Aux symbol info.
func (*Aux) Read ¶
func (*Aux) Size ¶
func (*Aux) Write ¶
type FuncInfo ¶
type FuncInfo struct { NoSplit uint8 Args uint32 Locals uint32 Pcsp uint32 Pcfile uint32 Pcline uint32 Pcinline uint32 Pcdata []uint32 PcdataEnd uint32 Funcdataoff []uint32 File []SymRef // TODO: just use string? InlTree []InlTreeNode }
FuncInfo is serialized as a symbol (aux symbol). The symbol data is the binary encoding of the struct below.
TODO: make each pcdata a separate symbol?
func (*FuncInfo) Read ¶
func (*FuncInfo) Write ¶
type Header ¶
File header. TODO: probably no need to export this.
func (*Header) Read ¶
func (*Header) Size ¶
func (*Header) Write ¶
type InlTreeNode ¶
InlTreeNode is the serialized form of FileInfo.InlTree.
func (*InlTreeNode) Read ¶
func (inl *InlTreeNode) Read(b []byte) []byte
Read an InlTreeNode from b, return the remaining bytes.
func (*InlTreeNode) Write ¶
func (inl *InlTreeNode) Write(w *bytes.Buffer)
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReaderFromBytes ¶
func (*Reader) Autolib ¶
func (*Reader) AuxOff ¶
AuxOff returns the offset of the j-th aux symbol of the i-th symbol.
func (*Reader) BytesAt ¶
func (*Reader) Data ¶
Data returns the i-th symbol's data.
func (*Reader) DataOff ¶
DataOff returns the offset of the i-th symbol's data.
func (*Reader) DataSize ¶
DataSize returns the size of the i-th symbol's data.
func (*Reader) DwarfFile ¶
func (*Reader) Flags ¶
Flags returns the flag bits read from the object file header.
func (*Reader) NAux ¶
NAux returns the number of aux symbols of the i-th symbol.
func (*Reader) NDwarfFile ¶
func (*Reader) NNonpkgdef ¶
func (*Reader) NNonpkgref ¶
func (*Reader) NPkg ¶
func (*Reader) NReloc ¶
NReloc returns the number of relocations of the i-th symbol.
func (*Reader) NSym ¶
func (*Reader) PcdataBase ¶
AuxDataBase returns the base offset of the aux data block.
func (*Reader) Pkg ¶
func (*Reader) Pkglist ¶
func (*Reader) ReadOnly ¶
ReadOnly returns whether r.BytesAt returns read-only bytes.
func (*Reader) RelocOff ¶
RelocOff returns the offset of the j-th relocation of the i-th symbol.
func (*Reader) StringAt ¶
func (*Reader) StringRef ¶
func (*Reader) SymOff ¶
SymOff returns the offset of the i-th symbol.
type Reloc ¶
Relocation.
func (*Reloc) Read ¶
func (*Reloc) Size ¶
func (*Reloc) Write ¶
type Sym ¶
Symbol definition.
func (*Sym) CFunc ¶
func (*Sym) Dupok ¶
func (*Sym) IsGoType ¶
func (*Sym) Leaf ¶
func (*Sym) Local ¶
func (*Sym) Read ¶
func (*Sym) ReflectMethod ¶
func (*Sym) Size ¶
func (*Sym) TopFrame ¶
func (*Sym) Typelink ¶
func (*Sym) Write ¶
type SymRef ¶
Symbol reference.
func (*SymRef) Read ¶
func (*SymRef) Size ¶
func (*SymRef) Write ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func (*Writer) AddString ¶
func (*Writer) Bytes ¶
func (*Writer) Offset ¶
func (*Writer) RawString ¶
func (*Writer) StringRef ¶
func (*Writer) Uint16 ¶
func (*Writer) Uint32 ¶
func (*Writer) Uint64 ¶
func (*Writer) Uint8 ¶
Source Files ¶
builtin.go builtinlist.go funcinfo.go objfile.go
- Version
- v1.14.6
- Published
- Jul 16, 2020
- Platform
- darwin/amd64
- Imports
- 7 packages
- Last checked
- 1 minute ago –
Tools for package owners.