Package ghidra.app.util.bin.format.xcoff

# Class XCoffOptionalHeader

java.lang.Object
ghidra.app.util.bin.format.xcoff.XCoffOptionalHeader

All Implemented Interfaces:
  `StructConverter`

public final class XCoffOptionalHeader extends Object implements StructConverter

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `AOUTHDRSZ`

  ### 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
  `byte`
  `getCpuFlag()`
  Returns the CPU bit flags.
  `byte`
  `getCpuType()`
  Reserved.
  `long`
  `getDataStart()`
  Returns the virtual address of the .data section.
  `long`
  `getDebugger()`
  This field should be 0.
  `long`
  `getEntry()`
  Returns the virtual address of the entry point.
  `byte`
  `getFlags()`
  This field consists of 4 1-bit flags and a 4-bit .tdata alignment.
  `long`
  `getInitializedDataSize()`
  Returns the size (in bytes) of the raw data for the .data section.
  `short`
  `getMagic()`
  Returns the magic value.
  `short`
  `getMaxAlignmentForData()`
  Returns log (base-2) of the maximum alignment needed for any csect in the .data or .bss section.
  `short`
  `getMaxAlignmentForText()`
  Returns log (base-2) of the maximum alignment needed for any csect in the .text section.
  `long`
  `getMaxDataSize()`
  Returns the maximum data size allowed for this executable.
  `long`
  `getMaxStackSize()`
  Returns the maximum stack size allowed for this executable.
  `String`
  `getModuleType()`
  Returns the module type.
  `short`
  `getSectionNumberForBss()`
  Returns the number of the .bss section.
  `short`
  `getSectionNumberForData()`
  Returns the number of the .data section.
  `short`
  `getSectionNumberForEntry()`
  Returns the number of the section that contains the entry point.
  `short`
  `getSectionNumberForLoader()`
  Returns the number of the section that contains the system loader information.
  `short`
  `getSectionNumberForTBss()`
  `short`
  `getSectionNumberForTData()`
  `short`
  `getSectionNumberForText()`
  Returns the number of the .text section.
  `short`
  `getSectionNumberForTOC()`
  Returns the number of the section that contains the TOC.
  `long`
  `getTextSize()`
  Returns the size (in bytes) of the raw data for the .text section.
  `long`
  `getTextStart()`
  Returns the virtual address of the .text section.
  `long`
  `getTOC()`
  Returns the virtual address of the TOC anchor.
  `long`
  `getUninitializedDataSize()`
  Returns the size (in bytes) of the .bss section.
  `short`
  `getVersionStamp()`
  Returns the format version for this auxiliary header.
  `DataType`
  `toDataType()`
  Returns a structure datatype representing the contents of the implementor of this interface.
  `String`
  `toString()`

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

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

- ## Field Details

  - ### AOUTHDRSZ

    public static final int AOUTHDRSZ
    See Also:
      - Constant Field Values

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getMagic

    public short getMagic()
    Returns the magic value. The binder assigns the following value: 0x010b.
    Returns:
      the magic value

  - ### getVersionStamp

    public short getVersionStamp()
    Returns the format version for this auxiliary header. The only valid value is 1.
    Returns:
      the format version for this auxiliary header

  - ### getTextSize

    public long getTextSize()
    Returns the size (in bytes) of the raw data for the .text section.
    Returns:
      the size (in bytes) of the raw data for the .text section

  - ### getInitializedDataSize

    public long getInitializedDataSize()
    Returns the size (in bytes) of the raw data for the .data section.
    Returns:
      the size (in bytes) of the raw data for the .data section

  - ### getUninitializedDataSize

    public long getUninitializedDataSize()
    Returns the size (in bytes) of the .bss section. No raw data exists in the file for the .bss section.
    Returns:
      the size (in bytes) of the .bss section

  - ### getEntry

    public long getEntry()
    Returns the virtual address of the entry point.
    Returns:
      the virtual address of the entry point

  - ### getTextStart

    public long getTextStart()
    Returns the virtual address of the .text section.
    Returns:
      the virtual address of the .text section

  - ### getDataStart

    public long getDataStart()
    Returns the virtual address of the .data section.
    Returns:
      the virtual address of the .data section

  - ### getTOC

    public long getTOC()
    Returns the virtual address of the TOC anchor.
    Returns:
      the virtual address of the TOC anchor

  - ### getSectionNumberForEntry

    public short getSectionNumberForEntry()
    Returns the number of the section that contains the entry point. The entry point must be in the .text or .data section.
    Returns:
      the number of the section that contains the entry point

  - ### getSectionNumberForText

    public short getSectionNumberForText()
    Returns the number of the .text section.
    Returns:
      the number of the .text section

  - ### getSectionNumberForData

    public short getSectionNumberForData()
    Returns the number of the .data section.
    Returns:
      the number of the .data section

  - ### getSectionNumberForTOC

    public short getSectionNumberForTOC()
    Returns the number of the section that contains the TOC.
    Returns:
      the number of the section that contains the TOC

  - ### getSectionNumberForLoader

    public short getSectionNumberForLoader()
    Returns the number of the section that contains the system loader information.
    Returns:
      the number of the section that contains the system loader information

  - ### getSectionNumberForBss

    public short getSectionNumberForBss()
    Returns the number of the .bss section.
    Returns:
      the number of the .bss section

  - ### getMaxAlignmentForText

    public short getMaxAlignmentForText()
    Returns log (base-2) of the maximum alignment needed for any csect in the .text section.
    Returns:
      the maximum alignment for the .text section

  - ### getMaxAlignmentForData

    public short getMaxAlignmentForData()
    Returns log (base-2) of the maximum alignment needed for any csect in the .data or .bss section.
    Returns:
      the maximum alignment for the .data or .bss section

  - ### getModuleType

    public String getModuleType()
    Returns the module type. Valid module types: RO - Specifies a read-only module.
    Returns:
      the module type

  - ### getCpuFlag

    public byte getCpuFlag()
    Returns the CPU bit flags.
    Returns:
      the CPU bit flags

  - ### getCpuType

    public byte getCpuType()
    Reserved. Always returns 0.
    Returns:
      always returns 0

  - ### getMaxStackSize

    public long getMaxStackSize()
    Returns the maximum stack size allowed for this executable. If the value is 0, then the default value is used.
    Returns:
      the maximum stack size allow for this executable

  - ### getMaxDataSize

    public long getMaxDataSize()
    Returns the maximum data size allowed for this executable. If the value is 0, then the default value is used.
    Returns:
      the maximum data size allow for this executable

  - ### getDebugger

    public long getDebugger()
    This field should be 0. When the loaded program is being debugged, the memory image of this field may be modified by the debugger to insert a trap instruction.
    Returns:
      should return 0

  - ### getFlags

    public byte getFlags()
    This field consists of 4 1-bit flags and a 4-bit .tdata alignment.
    Returns:
      the flags

  - ### getSectionNumberForTData

    public short getSectionNumberForTData()

  - ### getSectionNumberForTBss

    public short getSectionNumberForTBss()

  - ### 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`
    See Also:
      - `StructureDataType`