shn_undef: marks an undefined, missing or irrelevant section reference. * Present here instead of in elf_section_header_table.lem because a calculation * below requires this constant (i.e. forward reference in the ELF spec).
shn_xindex: an escape value. It indicates the actual section header index * is too large to fit in the containing field and is located in another * location (specific to the structure where it appears). Present here instead * of in elf_section_header_table.lem because a calculation below requires this * constant (i.e. forward reference in the ELF spec).
ELF object file types. Enumerates the ELF object file types specified in the * System V ABI. Values between elf_ft_lo_os and elf_ft_hi_os inclusive are * reserved for operating system specific values typically defined in an * addendum to the System V ABI for that operating system. Values between * elf_ft_lo_proc and elf_ft_hi_proc inclusive are processor specific and * are typically defined in an addendum to the System V ABI for that processor * series.
string_of_elf_file_type os proc m produces a string representation of the * numeric encoding m of the ELF file type. For values reserved for OS or * processor specific values, the higher-order functions os and proc are * used for printing, respectively.
val is_operating_system_specific_object_file_type_value :
Nat_big_num.num->
bool
is_operating_specific_file_type_value checks whether a numeric value is * reserved by the ABI for operating system-specific purposes.
val is_processor_specific_object_file_type_value : Nat_big_num.num-> bool
is_processor_specific_file_type_value checks whether a numeric value is * reserved by the ABI for processor-specific purposes.
val string_of_elf_machine_architecture : Nat_big_num.num-> string
string_of_elf_machine_architecture m produces a string representation of * the numeric encoding m of the ELF machine architecture. * TODO: finish this .
ELF version numbers. Denotes the ELF version number of an ELF file. Current is * defined to have a value of 1 with the present specification. Extensions * may create versions of ELF with higher version numbers.
Position: e*_identelf_ii_mag3, 'F' format identifier
ELf file classes. The file format is designed to be portable among machines * of various sizes, without imposing the sizes of the largest machine on the * smallest. The class of the file defines the basic types used by the data * structures of the object file container itself.
string_of_elf_file_class m produces a string representation of the numeric * encoding m of the ELF file class.
ELF data encodings. Byte e_identelf_ei_data specifies the encoding of both the * data structures used by object file container and data contained in object * file sections.
string_of_elf_data_encoding m produces a string representation of the * numeric encoding m of the ELF data encoding.
OS and ABI versions. Byte e_identelf_ei_osabi identifies the OS- or * ABI-specific ELF extensions used by this file. Some fields in other ELF * structures have flags and values that have operating system and/or ABI * specific meanings; the interpretation of those fields is determined by the * value of this byte.
is_valid_elf32_header hdr checks whether header hdr is valid, i.e. has * the correct magic numbers. * TODO: this should be expanded, presumably, or merged with some of the other * checks.
is_valid_elf64_header hdr checks whether header hdr is valid, i.e. has * the correct magic numbers. * TODO: this should be expanded, presumably, or merged with some of the other * checks.
elf32_header_compare hdr1 hdr2 is an ordering comparison function for * ELF headers suitable for use in sets, finite maps and other ordered * data types.
elf64_header_compare hdr1 hdr2 is an ordering comparison function for * ELF headers suitable for use in sets, finite maps and other ordered * data types.
get_elf64_version_number hdr returns the ELF file's declared version * number, extracting the information from header hdr.
val is_valid_elf32_version_numer : elf32_header-> bool
is_valid_elf32_version_number hdr checks whether an ELF file's declared * version number matches the current, mandatory version number. * TODO: this should be merged into is_valid_elf32_header to create a single * correctness check.
val is_valid_elf64_version_numer : elf64_header-> bool
is_valid_elf64_version_number hdr checks whether an ELF file's declared * version number matches the current, mandatory version number. * TODO: this should be merged into is_valid_elf64_header to create a single * correctness check.
get_elf64_header_endianness hdr returns the endianness of the ELF file * as declared in its header, hdr.
val has_elf32_header_associated_entry_point : elf32_header-> bool
has_elf32_header_associated_entry_point hdr checks whether the header * hdr declares an entry point for the program.
val has_elf64_header_associated_entry_point : elf64_header-> bool
has_elf64_header_associated_entry_point hdr checks whether the header * hdr declares an entry point for the program.
val has_elf32_header_string_table : elf32_header-> bool
has_elf32_header_string_table hdr checks whether the header * hdr declares whether the program has a string table or not.
val has_elf64_header_string_table : elf64_header-> bool
has_elf64_header_string_table hdr checks whether the header * hdr declares whether the program has a string table or not.
val is_elf32_header_section_size_in_section_header_table : elf32_header-> bool
is_elf32_header_section_size_in_section_header_table hdr checks whether the header * hdr declares whether the section size is too large to fit in the header * field and is instead stored in the section header table.
val is_elf64_header_section_size_in_section_header_table : elf64_header-> bool
is_elf64_header_section_size_in_section_header_table hdr checks whether the header * hdr declares whether the section size is too large to fit in the header * field and is instead stored in the section header table.
val is_elf32_header_string_table_index_in_link : elf32_header-> bool
is_elf32_header_string_table_index_in_link hdr checks whether the header * hdr declares whether the string table index is too large to fit in the * header's field and is instead stored in the link field of an entry in the * section header table.
val is_elf64_header_string_table_index_in_link : elf64_header-> bool
is_elf64_header_string_table_index_in_link hdr checks whether the header * hdr declares whether the string table index is too large to fit in the * header's field and is instead stored in the link field of an entry in the * section header table.
The hdr_print_bundle type is used to tidy up other type signatures. Some of the * top-level string_of_ functions require six or more functions passed to them, * which quickly gets out of hand. This type is used to reduce that complexity. * The first component of the type is an OS specific print function, the second is * a processor specific print function.
read_elf_ident bs0 reads the initial bytes of an ELF file from byte sequence * bs0, returning the remainder of the byte sequence too. * Fails if transcription fails.
is_elf32_header_valid checks whether an elf32_header value is a valid 32-bit * ELF file header (i.e. elf32_ident is ei_nident entries long, and other * constraints on headers).