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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the relocatable property in the program information property list.
  • Method Summary

    Modifier and Type
    Method
    Description
    add(Address addr, int type, long[] values, byte[] bytes, String symbolName)
    Creates 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.
    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
    Returns the number of relocation in this table.
    boolean
    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

      static final String RELOCATABLE_PROP_NAME
      Name of the relocatable property in the program information property list.
      See Also:
  • Method Details

    • add

      Relocation add(Address addr, int type, long[] values, byte[] bytes, String symbolName)
      Creates and adds a new relocation with the specified address, type, and value.
      Parameters:
      addr - the address where the relocation is required
      type - the type of relocation to perform
      values - 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 underlying FileBytes.
      symbolName - the name of the symbol being relocated; may be null
      Returns:
      the newly added relocation object
    • getRelocations

      List<Relocation> getRelocations(Address addr)
      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

      boolean hasRelocation(Address addr)
      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

      Iterator<Relocation> getRelocations(AddressSetView set)
      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

      Address getRelocationAddressAfter(Address addr)
      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