Next: , Up: r6rs-elf API   [Contents][Index]


2.1 Record constructors

Constructors are low-level procedures that you typically do not have to invoke yourself as the records are constructed by the parsing procedures. We document them here because you can learn about what records are offered by the library and what their fields are. Most of the Scheme records documented below have a C counterpart.

For example, to access the ‘data’ field of an ‘<elf-ident>’ object, use the ‘elf-ident-data’ procedure. All of the records are immutable.

Procedure: make-elf-ident magic class data version osabi abiversion pad

Constructs an <elf-ident>, the Scheme analogue of the first 16 bytes of the ELF header, also known as the ELF identifier.

Procedure: make-elf-header elf-ident type machine version entry phoff shoff flags ehsize phentsize phnum shentsize shnum shstrndx

Constructs an <elf-header>, the Scheme analogue of ‘ElfN_Ehdr’. The first parameter, elf-ident, is an instance of <elf-ident>. The accessors of <elf-ident> also apply to instances of <elf-header> as the former is a parent record of the latter.

Procedure: make-elf-region-header offset size

Constructs an <elf-region-header>. This record does not have an ELF analogue, but it is a useful record to provide an offset and a size field; both the program header and section header records have such fields, albeit with different names. This parent record allows us to also provide uniform accessors for these two distinct records.

Procedure: make-elf-program-header type offset vaddr paddr filesz memsz flags align

Constructs an <elf-program-header>, the Scheme analogue of ‘ElfN_Phdr’.

Procedure: make-elf-section-header name type flags addr offset size link info addralign entsize

Constructs an <elf-section-header>, the Scheme analogue of ‘ElfN_Shdr’.

Procedure: make-elf-sym name value size info other shndx

Constructs an <elf-sym>, the Scheme analogue of ‘ElfN_Sym’.

Procedure: make-elf-rel offset info

Constructs an <elf-rel>, the Scheme analogue of ‘ElfN_Rel’.

Procedure: make-elf-rela offset info addend

Constructs an <elf-rela>, the Scheme analogue of ‘ElfN_Rela’.

Procedure: make-elf-dyn tag val

Constructs an <elf-dyn>, the Scheme analogue of ‘ElfN_Dyn’.

Procedure: make-elf-nhdr namesz descsz type

Constructs an <elf-nhdr>, the Scheme analogue of ‘ElfN_Nhdr’.

Procedure: make-elf-note elf-nhdr name desc

Constructs an <elf-note>, which contains both the note header and the note itself. The first parameter, elf-nhdr, is an instance of <elf-nhdr>. The accessors of <elf-nhdr> also apply to instances of <elf-note> as the former record is a parent of the later.


Next: IO procedures, Up: r6rs-elf API   [Contents][Index]