Documentation ¶
Index ¶
- type GnuAssembler
- func (g GnuAssembler) Architecture() string
- func (g GnuAssembler) AssembleToMachineCode(file string, asOpts []string) (string, string, error)
- func (g GnuAssembler) ParseObjectSymbols(objectFile string) ([]assembler.Symbol, error)
- func (g GnuAssembler) ProcessMachineCodeToInstructions(objectFile string, syms map[string]assembler.Symbol) (map[string][]assembler.MachineInstruction, error)
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 ¶
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
Click to show internal directories.
Click to hide internal directories.