9.0
top
← prev up next →

Racket BinutilsπŸ”— i

This package is not stable, and is likely to break compatibility in the future.

(require binutils ) package: binutils

1Binary ObjectsπŸ”— i

struct

(struct bin:object (sections)
#:extra-constructor-namemake-bin:object)
sections:(listof bin:section? )
Represents a binary object.

struct

size
writable?
executable?
data
symbols
relocations)
#:extra-constructor-namemake-bin:section)
name:(or/c bytes? #f)
writable?:boolean?
executable?:boolean?
data:(or/c bytes? #f)
symbols:(listof bin:symbol? )
relocations:(listof bin:relocation? )
Represents a section of a binary object.

struct

(struct bin:symbol (namevaluesizebindingtype)
#:extra-constructor-namemake-bin:symbol)
name:symbol?
binding:(one-of/c 'local'global'weak#f)
type:(one-of/c 'object'function#f)
Represents a symbol for linking.

struct

(struct bin:relocation (offsetsizesymboltypeaddend)
#:extra-constructor-namemake-bin:relocation)
symbol:symbol?
type:(one-of/c 'address'offset'value'size)
Represents a relocation.

2LinkingπŸ”— i

Resolves local relative references in obj.

3Dynamic LoadingπŸ”— i

This is unsafe (particularly if there are bugs, which is likely) - it could cause crashes or worse!

Represents an object which has been loaded into memory.

method

(send a-dynamic-object symbols )(listof symbol? )

Returns a list of symbols exported by the object.

method

(send a-dynamic-object symbol-ref name)cpointer?

name:symbol?
Returns a pointer to the requested symbol. This may be cast into a function type.

Loads obj into memory.

4ELF SupportπŸ”— i

4.1Reading and WritingπŸ”— i

procedure

( read-elf [in])(is-a?/c elf% )

Reads an ELF binary from in.

procedure

( write-elf v[out])void?

Writes v as an ELF binary to out.

4.2ConversionπŸ”— i

procedure

( elf->bin:object elf)(bin:object? )

elf:(is-a?/c elf% )
Converts elf to a generic object. Some information will be lost in this process.

procedure

( bin:object->elf obj)(is-a?/c elf% )

Converts obj to an ELF object.

4.3ELF Data StructuresπŸ”— i

These classes represent the ELF format. For details, see the ELF specification and the source code of this module.

class

elf% :class?

superclass:object%

extends: binary<%>

method

(send an-elf repack! )void?

Adjusts sizes and offsets to fit the contents of the object.

4.4UtilitiesπŸ”— i

procedure

( system-elf-class )(or/c 'elf32'elf64)

Returns the appropriate ELF class for the current processor.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /