Package net.fornwall.jelf
Class ElfSegment
java.lang.Object
net.fornwall.jelf.ElfSegment
Class corresponding to the Elf32_Phdr/Elf64_Phdr struct.
An executable or shared object file's program header table is an array of structures, each describing a segment or
other information the system needs to prepare the program for execution. An object file segment contains one or more
sections. Program headers are meaningful only for executable and shared object files. A file specifies its own
program header size with the ELF header's e_phentsize and e_phnum members.
http://www.sco.com/developers/gabi/latest/ch5.pheader.html#p_type http://stackoverflow.com/questions/22612735/how-can-i-find-the-dynamic-libraries-required-by-an-elf-binary-in-c
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal longElf{32,64}_Phdr#p_align.final longElf{32,64}_Phdr#p_filesz.final intFlags relevant to this segment.final longElf{32,64}_Phdr#p_memsz.final longElf{32,64}_Phdr#p_offset.final longReserved for the physical address of the segment on systems where physical addressing is relevant.final intElf{32,64}_Phdr#p_type.final longElf{32,64}_Phdr#p_vaddr.static final intThe array element specifies dynamic linking information.static final intUpper bound of the range reserved for operating system-specific semantics.static final intUpper bound of the range reserved for processor-specific semantics.static final intThe array element specifies the location and size of a null-terminated path name to invoke as an interpreter.static final intType defining that the array element specifies a loadable segment.static final intLower bound of the range reserved for operating system-specific semantics.static final intLower bound of the range reserved for processor-specific semantics.static final intThe array element specifies the location and size of auxiliary information.static final intType defining that the array element is unused.static final intThe array element, if present, specifies the location and size of the program header table itself, both in the file and in the memory image of the program.static final intThis segment type is reserved but has unspecified semantics.static final intThe array element specifies the Thread-Local Storage template. -
Method Summary
-
Field Details
-
PT_NULL
public static final int PT_NULLType defining that the array element is unused. Other member values are undefined.- See Also:
-
PT_LOAD
public static final int PT_LOADType defining that the array element specifies a loadable segment.- See Also:
-
PT_DYNAMIC
public static final int PT_DYNAMICThe array element specifies dynamic linking information.- See Also:
-
PT_INTERP
public static final int PT_INTERPThe array element specifies the location and size of a null-terminated path name to invoke as an interpreter. Meaningful only for executable files (though it may occur for shared objects); it may not occur more than once in a file. If it is present, it must precede any loadable segment entry.- See Also:
-
PT_NOTE
public static final int PT_NOTEThe array element specifies the location and size of auxiliary information.- See Also:
-
PT_SHLIB
public static final int PT_SHLIBThis segment type is reserved but has unspecified semantics.- See Also:
-
PT_PHDR
public static final int PT_PHDRThe array element, if present, specifies the location and size of the program header table itself, both in the file and in the memory image of the program. This segment type may not occur more than once in a file.- See Also:
-
PT_TLS
public static final int PT_TLSThe array element specifies the Thread-Local Storage template.- See Also:
-
PT_LOOS
public static final int PT_LOOSLower bound of the range reserved for operating system-specific semantics.- See Also:
-
PT_HIOS
public static final int PT_HIOSUpper bound of the range reserved for operating system-specific semantics.- See Also:
-
PT_LOPROC
public static final int PT_LOPROCLower bound of the range reserved for processor-specific semantics.- See Also:
-
PT_HIPROC
public static final int PT_HIPROCUpper bound of the range reserved for processor-specific semantics.- See Also:
-
p_type
public final int p_typeElf{32,64}_Phdr#p_type. Kind of segment this element describes. -
p_flags
public final int p_flagsFlags relevant to this segment. Values for flags are defined in ELFSectionHeader. -
p_offset
public final long p_offsetElf{32,64}_Phdr#p_offset. File offset at which the first byte of the segment resides. -
p_vaddr
public final long p_vaddrElf{32,64}_Phdr#p_vaddr. Virtual address at which the first byte of the segment resides in memory. -
p_paddr
public final long p_paddrReserved for the physical address of the segment on systems where physical addressing is relevant. -
p_filesz
public final long p_fileszElf{32,64}_Phdr#p_filesz. File image size of segment in bytes, may be 0. -
p_memsz
public final long p_memszElf{32,64}_Phdr#p_memsz. Memory image size of segment in bytes, may be 0. -
p_align
public final long p_alignElf{32,64}_Phdr#p_align. The value to which the segments are aligned in memory and in the file.
-
-
Method Details