shn_hios: end of the range reserved for operating system-specific * semantics.
shn_abs: specifies the absolute values for the corresponding reference. * Symbols defined relative to section number shn_abs have absolute values * and are not affected by relocation.
shn_abs: specifies the absolute values for the corresponding reference. * Symbols defined relative to section number shn_abs have absolute values * and are not affected by relocation.
shn_common: symbols defined relative to this index are common symbols, * such as unallocated C external variables.
The following two section types hold a symbol table. An object file may only * have one symbol table of each of the respective types. The symtab provides * a place for link editing, whereas the dynsym section holds a minimal set of * dynamic linking symbols
The following two section types hold a symbol table. An object file may only * have one symbol table of each of the respective types. The symtab provides * a place for link editing, whereas the dynsym section holds a minimal set of * dynamic linking symbols
Section contains an array of pointers to termination functions. Each * pointer is taken as a parameterless function with a void return type.
Section contains an array of pointers to initialisation functions that are * invoked before all other initialisation functions. Each * pointer is taken as a parameterless function with a void return type.
Section contains an array of pointers to initialisation functions that are * invoked before all other initialisation functions. Each * pointer is taken as a parameterless function with a void return type.
Section defines a section group, i.e. a set of sections that are related and * must be treated especially by the linker. May only appear in relocatable * objects.
Section defines a section group, i.e. a set of sections that are related and * must be treated especially by the linker. May only appear in relocatable * objects.
Section is associated with sections of type SHT_SYMTAB and is required if * any of the section header indices referenced by that symbol table contains * the escape value SHN_XINDEX. * * FIXME: Lem bug as int type used throughout Lem codebase, rather than * BigInt.t, so Lem chokes on these large constants below, hence the weird * way in which they are written.
Section is associated with sections of type SHT_SYMTAB and is required if * any of the section header indices referenced by that symbol table contains * the escape value SHN_XINDEX. * * FIXME: Lem bug as int type used throughout Lem codebase, rather than * BigInt.t, so Lem chokes on these large constants below, hence the weird * way in which they are written.
string_of_section_type os proc user i produces a string-based representation * of section type i. Some section types are defined by ABI-specific supplements * in reserved ranges, in which case the functions os, proc and user are * used to produce the string.
The data in the section may be merged to reduce duplication. Each section * is compared based on name, type and flags set with sections with identical * values at run time being mergeable.
The data in the section may be merged to reduce duplication. Each section * is compared based on name, type and flags set with sections with identical * values at run time being mergeable.
The section contains null-terminated character strings.
val string_of_section_flags : 'a->'b->Nat_big_num.num-> string
string_of_section_flags os proc f produces a string based representation * of section flag f. Some section flags are defined by the ABI and are in * reserved ranges, in which case the flag string is produced by functions * os and proc. * TODO: add more as validation tests require them.
Specifies the required alignment of the uncompressed data
*)
}
Type elf32_compression_header provides information about the compression and * decompression of compressed sections. All compressed sections on ELF32 begin * with an elf32_compression_header entry.
Specifies the required alignment of the uncompressed data
*)
}
Type elf64_compression_header provides information about the compression and * decompression of compressed sections. All compressed sections on ELF64 begin * with an elf64_compression_header entry.
This section is compressed with the ZLIB algorithm. The compressed data begins * at the first byte immediately following the end of the compression header.
read_elf32_compression_header ed bs0 reads an elf32_compression_header * entry from byte sequence bs0, interpreting bs0 with endianness ed. * Also returns the suffix of bs0 after reading in the compression header. * Fails if the header cannot be read.
read_elf64_compression_header ed bs0 reads an elf64_compression_header * entry from byte sequence bs0, interpreting bs0 with endianness ed. * Also returns the suffix of bs0 after reading in the compression header. * Fails if the header cannot be read.
elf32_section_header_table_entry is the type of entries in the section * header table in 32-bit ELF files. Each entry in the table details a section * in the body of the ELF file.
compare_elf32_section_header_table_entry ent1 ent2 is an ordering comparison * function on section header table entries suitable for use in constructing * sets, finite maps and other ordered data types.
elf64_section_header_table_entry is the type of entries in the section * header table in 64-bit ELF files. Each entry in the table details a section * in the body of the ELF file.
compare_elf64_section_header_table_entry ent1 ent2 is an ordering comparison * function on section header table entries suitable for use in constructing * sets, finite maps and other ordered data types.
Type elf32_section_header_table represents a section header table for 32-bit * ELF files. A section header table is an array (implemented as a list, here) * of section header table entries.
Type elf64_section_header_table represents a section header table for 64-bit * ELF files. A section header table is an array (implemented as a list, here) * of section header table entries.
read_elf32_section_header_table_entry ed bs0 reads a section header table * entry from bs0 assuming endianness ed. Also returns the suffix of bs0 * after parsing. Fails if the entry cannot be read.
read_elf64_section_header_table_entry ed bs0 reads a section header table * entry from bs0 assuming endianness ed. Also returns the suffix of bs0 * after parsing. Fails if the entry cannot be read.
read_elf32_section_header_table' ed bs0 parses an ELF32 section header table * from byte sequence bs0 assuming endianness ed. Assumes bs0 is of the * exact length required to parse the entire table. * Fails if any of the section header table entries cannot be parsed.
read_elf64_section_header_table' ed bs0 parses an ELF64 section header table * from byte sequence bs0 assuming endianness ed. Assumes bs0 is of the * exact length required to parse the entire table. * Fails if any of the section header table entries cannot be parsed.
read_elf32_section_header_table sz ed bs0 parses an ELF32 section header * table from a sz sized prefix of byte sequence bs0 assuming endianness * ed. The suffix of bs0 remaining after parsing is also returned. * Fails if any of the section header entries cannot be parsed or if sz is * greater than the length of bs0.
read_elf64_section_header_table sz ed bs0 parses an ELF64 section header * table from a sz sized prefix of byte sequence bs0 assuming endianness * ed. The suffix of bs0 remaining after parsing is also returned. * Fails if any of the section header entries cannot be parsed or if sz is * greater than the length of bs0.
is_elf32_addr_addralign_correct ent checks whether an internal address * alignment constraint is met on section header table ent. * TODO: needs tweaking to add in power-of-two constraint, too.
is_elf64_addr_addralign_correct ent checks whether an internal address * alignment constraint is met on section header table ent. * TODO: needs tweaking to add in power-of-two constraint, too.
The sht_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.
string_of_elf32_section_header_table_entry sht ent produces a string * representation of section header table entry ent using sht, a * sht_print_bundle. * OCaml specific definition.
string_of_elf64_section_header_table_entry sht ent produces a string * representation of section header table entry ent using sht, a * sht_print_bundle. * OCaml specific definition.
string_of_elf32_section_header_table_entry' sht stab ent produces a string * representation of section header table entry ent using sht and section * header string table stab to print the name of the section header entry * correctly. * OCaml specific definition.
string_of_elf64_section_header_table_entry' sht stab ent produces a string * representation of section header table entry ent using sht and section * header string table stab to print the name of the section header entry * correctly. * OCaml specific definition.
The following defintions are default printing functions, with no ABI-specific * functionality, in order to produce a Show instance for section header * table entries.
get_elf32_section_to_segment_mapping hdr sht pht isin stbl computes the * section to segment mapping for an ELF file using information in the section * header table sht, program header table pht and file header hdr. A * string table stbl is taken to produce the string output. The test whether * a section lies withing a segment is ABI specific, so isin is used to perform * the test.
get_elf64_section_to_segment_mapping hdr sht pht isin stbl computes the * section to segment mapping for an ELF file using information in the section * header table sht, program header table pht and file header hdr. A * string table stbl is taken to produce the string output. The test whether * a section lies withing a segment is ABI specific, so isin is used to perform * the test.
obtain_elf32_section_group_indices endian sht bs0 extracts all section header * table indices of sections that are marked as being part of a section group.
obtain_elf64_section_group_indices endian sht bs0 extracts all section header * table indices of sections that are marked as being part of a section group.
obtain_elf32_hash_table endian sht bs0 extracts a hash table from an ELF file * providing a section of type SHT_HASH exists in section header table sht. * Extraction is from byte sequence bs0 assuming endianness endian. The * return type represents the number of buckets, the number of chains, the buckets * and finally the chains.
obtain_elf64_hash_table endian sht bs0 extracts a hash table from an ELF file * providing a section of type SHT_HASH exists in section header table sht. * Extraction is from byte sequence bs0 assuming endianness endian. The * return type represents the number of buckets, the number of chains, the buckets * and finally the chains.
construct_special_sections contains a finite map from section name (as * a string) to the expected attributes and flags expected of that section, * as specified in the ELF specification. * NOTE: some of these are overriden by the ABI.