Class ElfSectionHeader
An object file's section header table lets one locate all the file's sections. The section header table is an array
of Elf32_Shdr or Elf64_Shdr structures. A section header table index is a subscript into this array. The ELF header's
e_shoff member gives the byte offset from the beginning of the file to the section header
table with each section header entry being e_shentsize bytes big.
e_shnum normally tells how many entries the section header table contains, but if the number
of sections is greater than or equal to SHN_LORESERVE (0xff00), e_shnum has the value SHN_UNDEF (0) and the actual
number of section header table entries is contained in the sh_size field of the section header at index 0 (otherwise,
the sh_size member of the initial entry contains 0).
Some section header table indexes are reserved in contexts where index size is restricted, for example, the st_shndx member of a symbol table entry and the e_shnum and e_shstrndx members of the ELF header. In such contexts, the reserved values do not represent actual sections in the object file. Also in such contexts, an escape value indicates that the actual section index is to be found elsewhere, in a larger field.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlag informing that section occupies memory during process execution.static final intFlag informing that section contains executable machine instructions.static final intFlag informing that all the bits in the mask are reserved for processor specific semantics.static final intFlag informing that this section contains data that should be writable during process execution.static final StringName for the section containing the dynamic string table.static final StringName for the section containing read-only initialized data.static final StringName for the section containing the string table.final longsh_addr.final longAddress alignment constraints for the section.final longSize of a fixed-size entry, 0 if none.final longFlags.final intExtra information determined by the section type.final intSection header table index link.final intIndex into the section header string table which gives the name of the section.final longOffset from beginning of file to first byte of the section.final longSize in bytes of the section.final intSection content and semantics.static final intSection holds information for dynamic linking.static final intThesh_typevalue for a section containing a minimal set of symbols needed for dynamic linking at runtime.static final intstatic final intA hash table for fast lookup of dynamic symbols.static final intstatic final intstatic final intstatic final intstatic final intSection holds symbol hash table.static final intUpper bound of the range of indexes reserved for operating system-specific semantics.static final intUpper bound of the range of indexes reserved for processor-specific semantics.static final intUpper bound of the range of indexes reserved for application programs.static final intstatic final intLower bound of the range of indexes reserved for operating system-specific semantics.static final intLower bound of the range of indexes reserved for processor-specific semantics.static final intLower bound of the range of indexes reserved for application programs.static final intSection occupies no space but resembles TYPE_PROGBITS.static final intSection holds information that marks the file.static final intMarks the section header as inactive; it does not have an associated section.static final intstatic final intSection holds information defined by the program.static final intSection holds relocation entries without explicit addends.static final intSection holds relocation entries with explicit addends.static final intSection is reserved but has unspecified semantics.static final intSection holds string table information.static final intThesh_typevalue for a section containing complete symbol table information necessary for link editing.static final int -
Method Summary
-
Field Details
-
SHT_NULL
public static final int SHT_NULLMarks the section header as inactive; it does not have an associated section. Other members of the section header have undefined values.- See Also:
-
SHT_PROGBITS
public static final int SHT_PROGBITSSection holds information defined by the program.- See Also:
-
SHT_SYMTAB
public static final int SHT_SYMTABThesh_typevalue for a section containing complete symbol table information necessary for link editing.See
ElfSymbolTableSection, which is the class representing sections of this type, for more information.- See Also:
-
SHT_STRTAB
public static final int SHT_STRTABSection holds string table information.- See Also:
-
SHT_RELA
public static final int SHT_RELASection holds relocation entries with explicit addends.- See Also:
-
SHT_HASH
public static final int SHT_HASHSection holds symbol hash table.- See Also:
-
SHT_DYNAMIC
public static final int SHT_DYNAMICSection holds information for dynamic linking. Only one per ELF file. The dynsym is allocable, and contains the symbols needed to support runtime operation.- See Also:
-
SHT_NOTE
public static final int SHT_NOTESection holds information that marks the file.- See Also:
-
SHT_NOBITS
public static final int SHT_NOBITSSection occupies no space but resembles TYPE_PROGBITS.- See Also:
-
SHT_REL
public static final int SHT_RELSection holds relocation entries without explicit addends.- See Also:
-
SHT_SHLIB
public static final int SHT_SHLIBSection is reserved but has unspecified semantics.- See Also:
-
SHT_DYNSYM
public static final int SHT_DYNSYMThesh_typevalue for a section containing a minimal set of symbols needed for dynamic linking at runtime.See
ElfSymbolTableSection, which is the class representing sections of this type, for more information.- See Also:
-
SHT_INIT_ARRAY
public static final int SHT_INIT_ARRAY- See Also:
-
SHT_FINI_ARRAY
public static final int SHT_FINI_ARRAY- See Also:
-
SHT_PREINIT_ARRAY
public static final int SHT_PREINIT_ARRAY- See Also:
-
SHT_GROUP
public static final int SHT_GROUP- See Also:
-
SHT_SYMTAB_SHNDX
public static final int SHT_SYMTAB_SHNDX- See Also:
-
SHT_GNU_HASH
public static final int SHT_GNU_HASHA hash table for fast lookup of dynamic symbols.See
ElfGnuHashTable.- See Also:
-
SHT_GNU_verdef
public static final int SHT_GNU_verdef- See Also:
-
SHT_GNU_verneed
public static final int SHT_GNU_verneed- See Also:
-
SHT_GNU_versym
public static final int SHT_GNU_versym- See Also:
-
SHT_LOOS
public static final int SHT_LOOSLower bound of the range of indexes reserved for operating system-specific semantics.- See Also:
-
SHT_HIOS
public static final int SHT_HIOSUpper bound of the range of indexes reserved for operating system-specific semantics.- See Also:
-
SHT_LOPROC
public static final int SHT_LOPROCLower bound of the range of indexes reserved for processor-specific semantics.- See Also:
-
SHT_HIPROC
public static final int SHT_HIPROCUpper bound of the range of indexes reserved for processor-specific semantics.- See Also:
-
SHT_LOUSER
public static final int SHT_LOUSERLower bound of the range of indexes reserved for application programs.- See Also:
-
SHT_HIUSER
public static final int SHT_HIUSERUpper bound of the range of indexes reserved for application programs.- See Also:
-
FLAG_WRITE
public static final int FLAG_WRITEFlag informing that this section contains data that should be writable during process execution.- See Also:
-
FLAG_ALLOC
public static final int FLAG_ALLOCFlag informing that section occupies memory during process execution.- See Also:
-
FLAG_EXEC_INSTR
public static final int FLAG_EXEC_INSTRFlag informing that section contains executable machine instructions.- See Also:
-
FLAG_MASK
public static final int FLAG_MASKFlag informing that all the bits in the mask are reserved for processor specific semantics.- See Also:
-
NAME_STRTAB
Name for the section containing the string table.This section contains a string table which contains names for symbol structures by being indexed by the
ElfSymbol.st_namefield.- See Also:
-
NAME_DYNSTR
Name for the section containing the dynamic string table.- See Also:
-
NAME_RODATA
Name for the section containing read-only initialized data.- See Also:
-
sh_name
public final int sh_nameIndex into the section header string table which gives the name of the section. -
sh_type
public final int sh_typeSection content and semantics. -
sh_flags
public final long sh_flagsFlags. -
sh_addr
public final long sh_addrsh_addr. If the section will be in the memory image of a process this will be the address at which the first byte of section will be loaded. Otherwise, this value is 0. -
sh_offset
public final long sh_offsetOffset from beginning of file to first byte of the section. -
sh_size
public final long sh_sizeSize in bytes of the section. TYPE_NOBITS is a special case. -
sh_link
public final int sh_linkSection header table index link. -
sh_info
public final int sh_infoExtra information determined by the section type. -
sh_addralign
public final long sh_addralignAddress alignment constraints for the section. -
sh_entsize
public final long sh_entsizeSize of a fixed-size entry, 0 if none.
-
-
Method Details