com.cmpware.elf
Class SectionHeader

java.lang.Object
  extended by com.cmpware.elf.SectionHeader

public class SectionHeader
extends java.lang.Object

This describes the ELF Section Header.

Copyright (c) 2004 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
 byte[] data
          The section data
 java.lang.String name
          The section name
 long sh_addr
          The section address
 int sh_addralign
          The section alignment constraint
 int sh_entsize
          The section table entry size (optional)
 long sh_flags
          The section flags
 int sh_info
          The Section info
 int sh_link
          The section header table index link
 int sh_name
          The Section name index
 long sh_offset
          The section offset in the Elf file (in bytes)
 long sh_size
          The section size (in bytes)
 int sh_type
          The section type
static int SHF_ALLOC
          Section occupies memory during execution attribute
static int SHF_EXECINSTR
          Section contains executable machine instructions
static int SHF_MASKPROC
          Reserved bits for processor-specific semantics
static int SHF_WRITE
          Writable section attribute
static int SHT_DYNAMIC
          Dynamic linking section
static int SHT_DYNSYM
          A symbol table section
static int SHT_HASH
          A symbol hash table section
static int SHT_HIPROC
          High value for processor-specific semantics section
static int SHT_HIUSER
          High value for application-specific semantics section
static int SHT_LOPROC
          Low value for processor-specific semantics section
static int SHT_LOUSER
          Low value for application-specific semantics section
static int SHT_NOBITS
          Similar section to SHT_PROGBITS, but occupies no space in the file (often a BSS)
static int SHT_NOTE
          An information section
static int SHT_NULL
          Null (inactive) section
static int SHT_PROGBITS
          Program defined section (code)
static int SHT_REL
          A relocation section for entries without an explicit addend
static int SHT_RELA
          A relocation section for entries with an explicit addend
static int SHT_SHLIB
          A reserved section
static int SHT_STRTAB
          A string table section
static int SHT_SYMTAB
          A symbol table section
 
Constructor Summary
SectionHeader()
           
 
Method Summary
 void read(ElfInputStream eis)
          This method fills in the ELF Section Header fields.
 java.lang.String toString()
          This method returns a string representation of the ELF section header.
 void write(ElfOutputStream eos)
          This method writes out the ELF Section Header fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

SHT_NULL

public static final int SHT_NULL
Null (inactive) section

See Also:
Constant Field Values

SHT_PROGBITS

public static final int SHT_PROGBITS
Program defined section (code)

See Also:
Constant Field Values

SHT_SYMTAB

public static final int SHT_SYMTAB
A symbol table section

See Also:
Constant Field Values

SHT_STRTAB

public static final int SHT_STRTAB
A string table section

See Also:
Constant Field Values

SHT_RELA

public static final int SHT_RELA
A relocation section for entries with an explicit addend

See Also:
Constant Field Values

SHT_HASH

public static final int SHT_HASH
A symbol hash table section

See Also:
Constant Field Values

SHT_DYNAMIC

public static final int SHT_DYNAMIC
Dynamic linking section

See Also:
Constant Field Values

SHT_NOTE

public static final int SHT_NOTE
An information section

See Also:
Constant Field Values

SHT_NOBITS

public static final int SHT_NOBITS
Similar section to SHT_PROGBITS, but occupies no space in the file (often a BSS)

See Also:
Constant Field Values

SHT_REL

public static final int SHT_REL
A relocation section for entries without an explicit addend

See Also:
Constant Field Values

SHT_SHLIB

public static final int SHT_SHLIB
A reserved section

See Also:
Constant Field Values

SHT_DYNSYM

public static final int SHT_DYNSYM
A symbol table section

See Also:
Constant Field Values

SHT_LOPROC

public static final int SHT_LOPROC
Low value for processor-specific semantics section

See Also:
Constant Field Values

SHT_HIPROC

public static final int SHT_HIPROC
High value for processor-specific semantics section

See Also:
Constant Field Values

SHT_LOUSER

public static final int SHT_LOUSER
Low value for application-specific semantics section

See Also:
Constant Field Values

SHT_HIUSER

public static final int SHT_HIUSER
High value for application-specific semantics section

See Also:
Constant Field Values

SHF_WRITE

public static final int SHF_WRITE
Writable section attribute

See Also:
Constant Field Values

SHF_ALLOC

public static final int SHF_ALLOC
Section occupies memory during execution attribute

See Also:
Constant Field Values

SHF_EXECINSTR

public static final int SHF_EXECINSTR
Section contains executable machine instructions

See Also:
Constant Field Values

SHF_MASKPROC

public static final int SHF_MASKPROC
Reserved bits for processor-specific semantics

See Also:
Constant Field Values

name

public java.lang.String name
The section name


sh_name

public int sh_name
The Section name index


sh_type

public int sh_type
The section type


sh_flags

public long sh_flags
The section flags


sh_addr

public long sh_addr
The section address


sh_offset

public long sh_offset
The section offset in the Elf file (in bytes)


sh_size

public long sh_size
The section size (in bytes)


sh_link

public int sh_link
The section header table index link


sh_info

public int sh_info
The Section info


sh_addralign

public int sh_addralign
The section alignment constraint


sh_entsize

public int sh_entsize
The section table entry size (optional)


data

public byte[] data
The section data

Constructor Detail

SectionHeader

public SectionHeader()
Method Detail

read

public void read(ElfInputStream eis)
          throws java.io.IOException
This method fills in the ELF Section Header fields.

Parameters:
eis - The ElfInputStream for the ELF file.
Throws:
java.io.IOException - if an error is encountered in reading the Data Input Stream.

write

public void write(ElfOutputStream eos)
           throws java.io.IOException
This method writes out the ELF Section Header fields.

Parameters:
eos - The ElfOutputStream for the ELF file.
Throws:
java.io.IOException - if an error is encountered in writing the Elf Output Stream.

toString

public java.lang.String toString()
This method returns a string representation of the ELF section header.

Overrides:
toString in class java.lang.Object
Returns:
This method returns a string representation of the ELF section header.