obj

package
v0.0.0-...-a912af1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2017 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
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.

View Source
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.
)
View Source
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

View Source
var (
	Framepointer_enabled     int
	Preemptibleloops_enabled int
)
View Source
var (
	GOOS  = envOr("GOOS", "linux")
	GOARM = goarm()
)

Functions

func Getgoos

func Getgoos() string

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 LSym

type LSym struct {
	Name    string
	Version int16
	Size    int
}

An LSym is the sort of symbol that is written to an object file.

func Linklookup

func Linklookup(ctxt *Link, name string, v int) *LSym

func (*LSym) String

func (s *LSym) String() string

The compiler needs LSym to satisfy fmt.Stringer, because it stores an LSym in ssa.ExternSymbol.

type Link struct {
	Arch                 *LinkArch
	Pathname             string
	Flag_shared          bool
	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 Linknew

func Linknew(arch *LinkArch) *Link

func (*Link) Diag

func (ctxt *Link) Diag(format string, args ...interface{})

func (*Link) FixedFrameSize

func (ctxt *Link) FixedFrameSize() int64

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.

func (*Link) Lookup

func (ctxt *Link) Lookup(name string, v int) *LSym

type LinkArch

type LinkArch struct {
	IntSize int
}

LinkArch is a stubbed struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL