Documentation
¶
Index ¶
- Constants
- func Dummy()
- func DumpCode(text []byte, archName string)
- func FindFileTab(fileName string, nameMap map[string]int, fileTab []uint32) int32
- func GetOpName(op uint) string
- func Grow(bytes *[]byte, size int)
- func IsExtraRegister(regName string) bool
- func MarkReloc(text []byte, relocs []Reloc, offset int, archName string)
- func OpString(op Op) string
- func PathToPrefix(s string) string
- func ReplacePkgPath(name, pkgpath string) string
- type Archive
- type Arg
- type Args
- type CgoImport
- type Epilogue
- type Func
- type FuncInfo
- type InlTreeNode
- type InlinedCall
- type Inst
- type Instruction
- type Name
- type ObjSymbol
- type Op
- type Pkg
- type Prefix
- type Prefixes
- type Reloc
- type Sym
Constants ¶
const ( InvalidIndex = uint32(0xFFFFFFFF) InlinedCallSize = int(unsafe.Sizeof(InlinedCall{})) UNRESOLVED_SYMREF_PREFIX = "unresolvedSymRef#" UNRESOLVED_SYMREF_FMT = UNRESOLVED_SYMREF_PREFIX + "%d#%d" )
Variables ¶
This section is empty.
Functions ¶
func FindFileTab ¶ added in v0.0.18
func IsExtraRegister ¶ added in v0.0.21
func PathToPrefix ¶ added in v0.0.19
func ReplacePkgPath ¶ added in v0.0.19
Types ¶
type Archive ¶ added in v0.0.20
type Archive struct {
// contains filtered or unexported fields
}
func (Archive) MarshalBinary ¶ added in v0.0.20
func (*Archive) UnmarshalBinary ¶ added in v0.0.20
type Arg ¶ added in v0.0.21
type Arg interface {
String() string
// contains filtered or unexported methods
}
An Arg is a single instruction argument, one of these types: Reg, Mem, Imm, Rel.
type Args ¶ added in v0.0.21
type Args [4]Arg
An Args holds the instruction arguments. If an instruction has fewer than 4 arguments, the final elements in the array are nil.
type InlTreeNode ¶
type InlinedCall ¶ added in v0.0.19
type InlinedCall struct {
// contains filtered or unexported fields
}
inlinedCall is the encoding of entries in the FUNCDATA_InlTree table.
func InitInlinedCall ¶ added in v0.0.19
func InitInlinedCall(inl InlTreeNode, funcid uint8, namemap map[string]int, filetab []uint32) InlinedCall
type Inst ¶ added in v0.0.21
type Inst struct {
Prefix Prefixes // Prefixes applied to the instruction.
Op Op // Opcode mnemonic
Opcode uint32 // Encoded opcode bits, left aligned (first byte is Opcode>>24, etc)
Args Args // Instruction arguments, in Intel order
Mode int // processor mode in bits: 16, 32, or 64
AddrSize int // address size in bits: 16, 32, or 64
DataSize int // operand size in bits: 16, 32, or 64
MemBytes int // size of memory argument in bytes: 1, 2, 4, 8, 16, and so on.
Len int // length of encoded instruction in bytes
PCRel int // length of PC-relative address in instruction encoding
PCRelOff int // index of start of PC-relative address in instruction encoding
}
An Inst is a single instruction.
type Instruction ¶ added in v0.0.21
type Pkg ¶
type Pkg struct {
Syms map[string]*ObjSymbol
CgoImports map[string]*CgoImport
GoArchive *Archive
SymIndex []string
Arch string
PkgPath string
File string
ImportPkgs []string
CUFiles []string
CUOffset int32
}
func (*Pkg) AddCgoFuncs ¶ added in v0.0.20
func (*Pkg) AddSymIndex ¶ added in v0.0.20
func (*Pkg) ResolveSymbols ¶ added in v0.0.20
type Prefix ¶ added in v0.0.21
type Prefix uint16
A Prefix represents an Intel instruction prefix. The low 8 bits are the actual prefix byte encoding, and the top 8 bits contain distinguishing bits and metadata.
type Prefixes ¶ added in v0.0.21
type Prefixes [14]Prefix
Prefixes is an array of prefixes associated with a single instruction. The prefixes are listed in the same order as found in the instruction: each prefix byte corresponds to one slot in the array. The first zero in the array marks the end of the prefixes.