Package net.fornwall.jelf
Class ElfRelocation
java.lang.Object
net.fornwall.jelf.ElfRelocation
A relocation connects a symbolic reference with its actual definition.
Relocatable files must have information that describes how to modify their
section contents, thus allowing executable and shared object files to hold
the right information for a process's program image. Relocation entries are
these data.
These elf relocation entries can be obtained from ElfRelocationSection:s.
Corresponds to the below C structs:
typedef struct {
Elf32_Addr r_offset;
Elf32_Word r_info;
} Elf32_Rel;
typedef struct {
Elf64_Addr r_offset;
Elf64_Xword r_info;
} Elf64_Rel;
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionThe symbol with respect to which the relocation must be made.intThe symbol table index, with respect to which the relocation must be made.longgetType()Corresponds to the ELF32_R_TYPE / ELF64_R_TYPE macros.
-
Field Details
-
r_offset
public final long r_offsetThe location at which to apply the relocation. For a relocatable file, this is the byte offset from the beginning of the section. For an executable or shared object, the value is the virtual address. -
r_info
public final long r_infoThis member gives both the symbol table index to which the relocation must be made, and the type of relocation to apply. Relocation types are processor specific.
-
-
Method Details
-
getType
public long getType()Corresponds to the ELF32_R_TYPE / ELF64_R_TYPE macros.- See Also:
-
getSymbolIndex
public int getSymbolIndex()The symbol table index, with respect to which the relocation must be made. UsegetSymbol()to get the resolvedElfSymbolfrom this index.Corresponds to the ELF32_R_SYM / ELF64_R_SYM macros.
-
getSymbol
The symbol with respect to which the relocation must be made. UsegetSymbolIndex()} to get the resolvedElfSymbolfrom this index.
-