Package ghidra.app.util.bin.format.som

# Class SomDynamicRelocation

java.lang.Object
ghidra.app.util.bin.format.som.SomDynamicRelocation

All Implemented Interfaces:
  `StructConverter`

public class SomDynamicRelocation extends Object implements StructConverter
Represents a SOM `dreloc_record` structure

See Also:
  - The 32-bit PA-RISC Run-time Architecture Document

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `SIZE`
  The size in bytes of a `SomDynamicRelocation`

  ### Fields inherited from interface ghidra.app.util.bin.StructConverter

  `ASCII, BYTE, DWORD, IBO32, IBO64, POINTER, QWORD, SLEB128, STRING, ULEB128, UTF16, UTF8, VOID, WORD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SomDynamicRelocation(BinaryReader reader)`
  Creates a new `SomDynamicRelocation`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getLocation()`
  Returns the data-relative offset of the data item the dreloc record refers to.
  `short`
  `getModuleIndex()`
  Returns the module index (currently reserved).
  `byte`
  `getReserved()`
  Returns the reserved value.
  `int`
  `getShlib()`
  Returns the shared library name (currently a reserved field).
  `int`
  `getSymbol()`
  Returns the index into the import table if the relocation is an external type.
  `int`
  `getType()`
  Returns the type of dynamic relocation.
  `int`
  `getValue()`
  Returns the text or data-relative offset to use for a patch if it is an internal fixup type.
  `DataType`
  `toDataType()`
  Returns a structure datatype representing the contents of the implementor of this interface.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### SIZE

    public static final int SIZE
    The size in bytes of a `SomDynamicRelocation`
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### SomDynamicRelocation

    public SomDynamicRelocation(BinaryReader reader) throws IOException
    Creates a new `SomDynamicRelocation`
    Parameters:
      `reader` - A `BinaryReader` positioned at the start of the dynamic relocation list
    Throws:
      `IOException` - if there was an IO-related error

- ## Method Details

  - ### getShlib

    public int getShlib()
    Returns the shared library name (currently a reserved field).
    Returns:
      the shared library name (currently a reserved field)

  - ### getSymbol

    public int getSymbol()
    Returns the index into the import table if the relocation is an external type.
    Returns:
      the index into the import table if the relocation is an external type

  - ### getLocation

    public int getLocation()
    Returns the data-relative offset of the data item the dreloc record refers to.
    Returns:
      the data-relative offset of the data item the dreloc record refers to

  - ### getValue

    public int getValue()
    Returns the text or data-relative offset to use for a patch if it is an internal fixup type.
    Returns:
      the text or data-relative offset to use for a patch if it is an internal fixup type

  - ### getType

    public int getType()
    Returns the type of dynamic relocation.
    Returns:
      the type of dynamic relocation
    See Also:
      - `SomConstants`

  - ### getReserved

    public byte getReserved()
    Returns the reserved value.
    Returns:
      the reserved value

  - ### getModuleIndex

    public short getModuleIndex()
    Returns the module index (currently reserved).
    Returns:
      the module index (currently reserved)

  - ### toDataType

    public DataType toDataType() throws DuplicateNameException, IOException
    Description copied from interface: `StructConverter`
    Returns a structure datatype representing the contents of the implementor of this interface.

    For example, given:

         class A {
             int foo;
             double bar;
         }

    The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.

    Specified by:
      `toDataType` in interface `StructConverter`
    Returns:
      returns a structure datatype representing the implementor of this interface
    Throws:
      `DuplicateNameException` - when a datatype of the same name already exists
      `IOException` - if an IO-related error occurs
    See Also:
      - `StructureDataType`