Documentation ¶
Index ¶
- Constants
- func Mmap(size int) ([]byte, error)
- func Munmap(b []byte) (err error)
- func Parse(f *os.File, pkgpath *string) ([]string, error)
- func RegSymbol(symPtr map[string]uintptr) error
- func RegSymbolWithSo(symPtr map[string]uintptr, path string) error
- func RegTypes(symPtr map[string]uintptr, interfaces ...interface{})
- type CodeModule
- type Func
- type FuncInfo
- type InlTreeNode
- type Linker
- type ObjSymbol
- type Pkg
- type Reloc
- type Sym
Constants ¶
View Source
const ( PtrSize = 4 << (^uintptr(0) >> 63) Uint32Size = int(unsafe.Sizeof(uint32(0))) IntSize = int(unsafe.Sizeof(int(0))) UInt64Size = int(unsafe.Sizeof(uint64(0))) ItabSize = int(unsafe.Sizeof(itab{})) FindFuncBucketSize = int(unsafe.Sizeof(findfuncbucket{})) InlinedCallSize = int(unsafe.Sizeof(inlinedCall{})) InvalidHandleValue = ^uintptr(0) InvalidOffset = int(-1) InvalidIndex = uint32(0xFFFFFFFF) PageSize = 1 << 12 //4096 )
size
View Source
const ( EmptyString = "" DefaultPkgPath = "main" EmptyPkgPath = `""` ZeroByte = byte(0x00) )
View Source
const ( FileSymPrefix = "gofile.." MainPkgPrefix = "main." TypeImportPathPrefix = "type..importpath." TypeDoubleDotPrefix = "type.." TypePrefix = "type." ItabPrefix = "go.itab." StkobjSuffix = ".stkobj" InlineTreeSuffix = ".inlinetree" OsStdout = "os.Stdout" )
string match prefix/suffix
View Source
const ( R_ADDR = 1 // R_ADDRARM64 relocates an adrp, add pair to compute the address of the // referenced symbol. R_ADDRARM64 = 3 // R_ADDROFF resolves to a 32-bit offset from the beginning of the section // holding the data being relocated to the referenced symbol. R_ADDROFF = 5 // R_WEAKADDROFF resolves just like R_ADDROFF but is a weak relocation. // A weak relocation does not make the symbol it refers to reachable, // and is only honored by the linker if the symbol is in some other way // reachable. R_WEAKADDROFF = 6 R_CALL = 8 R_CALLARM = 9 R_CALLARM64 = 10 R_CALLIND = 11 R_PCREL = 16 // R_TLS_LE, used on 386, amd64, and ARM, resolves to the offset of the // thread-local symbol from the thread local base and is used to implement the // "local exec" model for tls access (r.Sym is not set on intel platforms but is // set to a TLS symbol -- runtime.tlsg -- in the linker when externally linking). R_TLS_LE = 17 // R_USEIFACE marks a type is converted to an interface in the function this // relocation is applied to. The target is a type descriptor. // This is a marker relocation (0-sized), for the linker's reachabililty // analysis. R_USEIFACE = 25 // R_USEIFACEMETHOD marks an interface method that is used in the function // this relocation is applied to. The target is an interface type descriptor. // The addend is the offset of the method in the type descriptor. // This is a marker relocation (0-sized), for the linker's reachabililty // analysis. R_USEIFACEMETHOD = 26 // R_METHODOFF resolves to a 32-bit offset from the beginning of the section // holding the data being relocated to the referenced symbol. // It is a variant of R_ADDROFF used when linking from the uncommonType of a // *rtype, and may be set to zero by the linker if it determines the method // text is unreachable by the linked program. R_METHODOFF = 27 // R_ADDRCUOFF resolves to a pointer-sized offset from the start of the // symbol's DWARF compile unit. R_ADDRCUOFF = 58 //not used, only adapter golang 1.16 R_USETYPE = 0x10000000 - 4 R_WEAKADDR = 0x20000000 )
copy from $GOROOT/src/cmd/internal/objabi/reloctype.go
View Source
const ( // An otherwise invalid zero value for the type Sxxx = iota // Executable instructions STEXT // Read only static data SRODATA // Static data that does not contain any pointers SNOPTRDATA // Static data SDATA // Statically data that is initially all 0s SBSS // Statically data that is initially all 0s and does not contain pointers SNOPTRBSS // Thread-local data that is initially all 0s STLSBSS // Debugging data SDWARFCUINFO SDWARFCONST SDWARFFCN SDWARFABSFCN SDWARFTYPE SDWARFVAR SDWARFRANGE SDWARFLOC SDWARFLINES // ABI alias. An ABI alias symbol is an empty symbol with a // single relocation with 0 size that references the native // function implementation symbol. // // TODO(austin): Remove this and all uses once the compiler // generates real ABI wrappers rather than symbol aliases. SABIALIAS // Coverage instrumentation counter for libfuzzer. SLIBFUZZER_EXTRA_COUNTER )
copy from $GOROOT/src/cmd/internal/objabi/symkind.go
View Source
const (
KindGCProg = 1 << 6
)
View Source
const (
RuntimeDeferReturn = "runtime.deferreturn"
)
runtime symbol
View Source
const (
TLSNAME = "(TLS)"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodeModule ¶
func Load ¶
func Load(linker *Linker, symPtr map[string]uintptr) (codeModule *CodeModule, err error)
func (*CodeModule) Unload ¶
func (cm *CodeModule) Unload()
type InlTreeNode ¶
Source Files ¶
- arch.go
- asm_bytes.go
- const.go
- debug.go
- deferreturn.go
- dymcode.1.16.go
- dymcode.go
- gcdata.go
- iface.1.10.go
- iface.go
- init.1.13.go
- inlinetree.go
- mmap_linux_amd64.go
- module.1.16.go
- module.go
- readFuncInfo.1.16.go
- readobj.1.16.go
- readobj.go
- register.1.16.go
- register.go
- stackobject.1.12.go
- stackobject.go
- type.1.14.go
- type.go
- utils.go
Click to show internal directories.
Click to hide internal directories.