gnu

package
v0.0.0-...-2ff52b8 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GnuAssembler

type GnuAssembler struct {
	// The assembler executable itself - this should always be an absolute path
	AsExecutable string
	// The architecture to compile for
	Arch string
	// for cross-compilers such as arm-linux-gnueabihf-as, we can find other tools (such as objdump) automatically
	// by looking in the same folder as asExecutable and prepending the prefix to whatever tool we are looking
	// in the example for arm-linux-gnueabihf-as, prefix will be "arm-linux-gnueabihi-"
	Prefix string
	// the folder where tools such as gcc, as, objdump, strip etc. should all be found
	// this should always be equal to filepath.Split(g.asExecutable)
	BinToolsFolder string
}

GnuAssembler implements Assembler interface and works with gnu "as" (aka "gas") assembler

func (GnuAssembler) Architecture

func (g GnuAssembler) Architecture() string

Architecture returns the architecture of the this GNU assembler

func (GnuAssembler) AssembleToMachineCode

func (g GnuAssembler) AssembleToMachineCode(file string, asOpts []string) (string, string, error)

AssembleToMachineCode takes an assembly file with options and returns a corresponding compiled object file, and a assembly listing file

func (GnuAssembler) ParseObjectSymbols

func (g GnuAssembler) ParseObjectSymbols(objectFile string) ([]assembler.Symbol, error)

ParseObjectSymbols takes in an object file and returns a list of all symbols from that object file

func (GnuAssembler) ProcessMachineCodeToInstructions

func (g GnuAssembler) ProcessMachineCodeToInstructions(objectFile string, syms map[string]assembler.Symbol) (map[string][]assembler.MachineInstruction, error)

ProcessMachineCodeToInstructions takes in an object file and a map of symbol names -> Symbol that are to be processed and returns a map of symbol name -> machine instructions corresponding to that symbol

Jump to

Keyboard shortcuts

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