Documentation ¶
Index ¶
Constants ¶
const ( AXXX = 0 + iota ACALL ACHECKNIL ADATA ADUFFCOPY ADUFFZERO AEND AFUNCDATA AGLOBL AJMP ANOP APCDATA ARET ATEXT ATYPE AUNDEF AUSEFIELD AVARDEF AVARKILL A_ARCHSPECIFIC )
Prog.as opcodes. These are the portable opcodes, common to all architectures. Each architecture defines many more arch-specific opcodes, with values starting at A_ARCHSPECIFIC. Each architecture adds an offset to this so each machine has distinct space for its instructions. The offset is a power of two so it can be masked to return to origin zero. See the definitions of ABase386 etc.
const ( ABase386 = (1 + iota) << 12 ABaseARM ABaseAMD64 ABasePPC64 ABaseARM64 ABaseMIPS ABaseS390X AMask = 1<<12 - 1 // AND with this to use the opcode as an array index. )
const ( // Because of masking operations in the encodings, each register // space should start at 0 modulo some power of 2. RBase386 = 1 * 1024 RBaseAMD64 = 2 * 1024 RBaseARM = 3 * 1024 RBasePPC64 = 4 * 1024 // range [4k, 8k) RBaseARM64 = 8 * 1024 // range [8k, 12k) RBaseMIPS = 13 * 1024 // range [13k, 14k) RBaseS390X = 14 * 1024 // range [14k, 15k) )
Variables ¶
var ( Framepointer_enabled int Preemptibleloops_enabled int )
var ( GOOS = envOr("GOOS", "linux") GOARM = goarm() )
Functions ¶
func WorkingDir ¶
func WorkingDir() string
WorkingDir returns the current working directory (or "/???" if the directory cannot be identified), with "/" as separator.
Types ¶
type As ¶
type As int16
An As denotes an assembler opcode. There are some portable opcodes, declared here in package obj, that are common to all architectures. However, the majority of opcodes are arch-specific and are declared in their respective architecture's subpackage.
type Link ¶
type Link struct { Arch *LinkArch Pathname string Flag_dynlink bool Framepointer_enabled bool DiagFunc func(string, ...interface{}) Errors int }
Link holds the context for writing object code from a compiler to be linker input or for reading that input into the linker.
func (*Link) FixedFrameSize ¶
The smallest possible offset from the hardware stack pointer to a local variable on the stack. Architectures that use a link register save its value on the stack in the function prologue and so always have a pointer between the hardware stack pointer and the local variable area.