Package ghidra.app.util.bin.format.pef

# Class LoaderRelocationHeader

java.lang.Object
ghidra.app.util.bin.format.pef.LoaderRelocationHeader

All Implemented Interfaces:
  `StructConverter`

public class LoaderRelocationHeader extends Object implements StructConverter
See Apple's -- PEFBinaryFormat.h

     struct PEFLoaderRelocationHeader {
         UInt16   sectionIndex;     // Index of the section to be fixed up.
         UInt16   reservedA;        // Reserved, must be zero.
         UInt32   relocCount;       // Number of 16 bit relocation chunks.
         UInt32   firstRelocOffset; // Offset of first relocation instruction.
     };

     typedef UInt16 PEFRelocChunk;

- ## Field Summary

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

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getFirstRelocOffset()`
  The firstRelocOffset field (4 bytes) indicates the byte offset from the start of the relocations area to the first relocation instruction for this section.
  `List<Relocation>`
  `getRelocations()`
  `int`
  `getRelocCount()`
  The relocCount field (4 bytes) indicates the number of 16-bit relocation blocks for this section.
  `short`
  `getReservedA()`
  Reserved, must be set to zero (0).
  `short`
  `getSectionIndex()`
  The sectionIndex field (2 bytes) designates the section number to which this relocation header refers.
  `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`

- ## Method Details

  - ### getSectionIndex

    public short getSectionIndex()
    The sectionIndex field (2 bytes) designates the section number to which this relocation header refers.
    Returns:
      section number to which this relocation header refers

  - ### getReservedA

    public short getReservedA()
    Reserved, must be set to zero (0).
    Returns:
      reserved, must be set to zero (0)

  - ### getRelocCount

    public int getRelocCount()
    The relocCount field (4 bytes) indicates the number of 16-bit relocation blocks for this section.
    Returns:
      number of 16-bit relocation blocks for this section

  - ### getFirstRelocOffset

    public int getFirstRelocOffset()
    The firstRelocOffset field (4 bytes) indicates the byte offset from the start of the relocations area to the first relocation instruction for this section.
    Returns:
      offset from the start of the relocations area to the first relocation

  - ### getRelocations

    public List<Relocation> getRelocations()

  - ### 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`