Package ghidra.app.util.bin.format.elf

# Class ElfCompressedSectionHeader

java.lang.Object
ghidra.app.util.bin.format.elf.ElfCompressedSectionHeader

public class ElfCompressedSectionHeader extends Object
Header at the beginning of an ELF compressed section.

See https://docs.oracle.com/cd/E53394_01/html/E54813/section_compression.html

     typedef struct {
          Elf32_Word      ch_type;
          Elf32_Word      ch_size;
          Elf32_Word      ch_addralign;
     } Elf32_Chdr;

     typedef struct {
          Elf64_Word      ch_type;
          Elf64_Word      ch_reserved;
          Elf64_Xword     ch_size;
          Elf64_Xword     ch_addralign;
     } Elf64_Chdr;

- ## Field Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getCh_addralign()`
  Returns the address alignment value.
  `long`
  `getCh_size()`
  Returns the uncompressed size.
  `int`
  `getCh_type()`
  Returns the compression type, see ELFCOMPRESS_ZLIB.
  `int`
  `getHeaderSize()`
  Returns the size of this header struct.
  `static ElfCompressedSectionHeader`
  `read(BinaryReader reader, ElfHeader elf)`
  Reads an Elf(32|64)_Chdr from the current position in the supplied stream.

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

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

- ## Field Details

  - ### ELFCOMPRESS_ZLIB

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

- ## Method Details

  - ### read

    public static ElfCompressedSectionHeader read(BinaryReader reader, ElfHeader elf) throws IOException
    Reads an Elf(32|64)_Chdr from the current position in the supplied stream.
    Parameters:
      `reader` - stream to read from
      `elf` - ElfHeader that defines the format of the binary
    Returns:
      new `ElfCompressedSectionHeader` instance, never null
    Throws:
      `IOException` - if error reading the header

  - ### getCh_type

    public int getCh_type()
    Returns the compression type, see ELFCOMPRESS_ZLIB.
    Returns:
      the compression type, see ELFCOMPRESS_ZLIB

  - ### getCh_size

    public long getCh_size()
    Returns the uncompressed size.
    Returns:
      the uncompressed size

  - ### getCh_addralign

    public long getCh_addralign()
    Returns the address alignment value..

    See `ElfSectionHeader.getAddressAlignment()`

    Returns:
      the address alignment value

  - ### getHeaderSize

    public int getHeaderSize()
    Returns the size of this header struct.
    Returns:
      the size of this header struct