Package ghidra.program.model.reloc
Interface RelocationTable
- All Known Implementing Classes:
RelocationManager
public interface RelocationTable
An interface for storing the relocations defined in a program.
Table must preserve the order in which relocations are added such that
the iterators return them in the same order.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of the relocatable property in the program information property list. -
Method Summary
Modifier and TypeMethodDescriptionCreates and adds a new relocation with the specified address, type, and value.Returns the next relocation address which follows the specified address.Returns an iterator over all defined relocations (in ascending address order) located within the program.getRelocations
(Address addr) Returns the ordered list of relocations which have been defined for the specified address.Returns an iterator over all defined relocations (in ascending address order) located within the program over the specified address set.int
getSize()
Returns the number of relocation in this table.boolean
hasRelocation
(Address addr) Determine if the specified address has a relocation defined.boolean
Returns true if this relocation table contains relocations for a relocatable binary.
-
Field Details
-
RELOCATABLE_PROP_NAME
Name of the relocatable property in the program information property list.- See Also:
-
-
Method Details
-
add
Creates and adds a new relocation with the specified address, type, and value.- Parameters:
addr
- the address where the relocation is requiredtype
- the type of relocation to performvalues
- the values needed when performing the relocation. Definition of values is specific to loader used and relocation type.bytes
- original instruction bytes affected by relocation. A null value should be passed to rely on original underlyingFileBytes
.symbolName
- the name of the symbol being relocated; may be null- Returns:
- the newly added relocation object
-
getRelocations
Returns the ordered list of relocations which have been defined for the specified address. In most cases there will be one or none, but in some cases multiple relocations may be applied to a single address.- Parameters:
addr
- the address where the relocation(s) are defined- Returns:
- the ordered list of relocations which have been defined for the specified address.
-
hasRelocation
Determine if the specified address has a relocation defined.- Parameters:
addr
- memory address within program- Returns:
- true if relocation defined, otherwise false
-
getRelocations
Iterator<Relocation> getRelocations()Returns an iterator over all defined relocations (in ascending address order) located within the program.- Returns:
- ordered relocation iterator
-
getRelocations
Returns an iterator over all defined relocations (in ascending address order) located within the program over the specified address set.- Parameters:
set
- address set- Returns:
- ordered relocation iterator
-
getRelocationAddressAfter
Returns the next relocation address which follows the specified address.- Parameters:
addr
- starting point- Returns:
- next relocation address after addr or null if none
-
getSize
int getSize()Returns the number of relocation in this table.- Returns:
- the number of relocation in this table
-
isRelocatable
boolean isRelocatable()Returns true if this relocation table contains relocations for a relocatable binary. Some binaries may contain relocations, but not actually be relocatable. For example, ELF executables.- Returns:
- true if this relocation table contains relocations for a relocatable binary
-