Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Linker.ELF
Class ELFImpl  view ELFImpl download ELFImpl.java

java.lang.Object
  extended byLinker.ELF.ELFImpl
All Implemented Interfaces:
ELF, ELFConstants
Direct Known Subclasses:
ELFOutput, ELFRandomAccessFile

abstract class ELFImpl
extends java.lang.Object
implements ELF, ELFConstants

Version:
$Id: ELFImpl.java,v 1.2 2003/05/12 10:05:17 joewhaley Exp $

Field Summary
protected  int e_entry
           
protected  int e_flags
           
protected  int e_machine
           
protected  int e_type
           
protected  int e_version
           
protected  byte ei_class
           
protected  byte ei_data
           
protected  java.util.List program_headers
           
protected  Section.StrTabSection section_header_string_table
           
protected  java.util.List sections
           
 
Fields inherited from interface Linker.ELF.ELFConstants
ELFCLASS32, ELFCLASS64, ELFCLASSNONE, ELFDATA2LSB, ELFDATA2MSB, ELFDATANONE, ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, EM_386, EM_68K, EM_860, EM_88K, EM_M32, EM_MIPS, EM_MIPS_RS4_BE, EM_SPARC, ET_CORE, ET_DYN, ET_EXEC, ET_HIPROC, ET_LOPROC, ET_NONE, ET_REL, EV_CURRENT, EV_NONE, PT_DYNAMIC, PT_HIPROC, PT_INTERP, PT_LOAD, PT_LOPROC, PT_NOTE, PT_NULL, PT_PHDR, PT_SHLIB, R_386_32, R_386_NONE, R_386_PC32, SHF_ALLOC, SHF_EXECINSTR, SHF_MASKPROC, SHF_WRITE, SHN_ABS, SHN_COMMON, SHN_HIPROC, SHN_HIRESERVE, SHN_INVALID, SHN_LOPROC, SHN_LORESERVE, SHN_UNDEF, SHT_DYNAMIC, SHT_DYNSYM, SHT_HASH, SHT_HIPROC, SHT_HIUSER, SHT_LOPROC, SHT_LOUSER, SHT_NOBITS, SHT_NOTE, SHT_NULL, SHT_PROGBITS, SHT_REL, SHT_RELA, SHT_SHLIB, SHT_STRTAB, SHT_SYMTAB, STB_GLOBAL, STB_HIPROC, STB_LOCAL, STB_LOPROC, STB_WEAK, STT_FILE, STT_FUNC, STT_HIPROC, STT_LOPROC, STT_NOTYPE, STT_OBJECT, STT_SECTION
 
Constructor Summary
protected ELFImpl()
           
  ELFImpl(byte data, int type, int machine, int entry)
          Creates new ELFImpl
 
Method Summary
 void addProgramHeader(ProgramHeader p)
          Adds the given ELF program header to this object.
 void addSection(Section s)
          Adds the given ELF section to this object.
static int getHeaderSize()
           
 Section getSection(int i)
           
 Section.StrTabSection getSectionHeaderStringTable()
          Returns the section header string table, if one has been defined.
 int getSectionIndex(Section s)
           
 java.util.List getSections()
          Returns the list of ELF sections in this object.
 boolean isBigEndian()
          Returns true if this ELF object is big-endian.
 boolean isLittleEndian()
          Returns true if this ELF object is little-endian.
 void removeProgramHeader(ProgramHeader p)
          Removes the given ELF program header from this object.
 void removeSection(Section s)
          Removes the given ELF section from this object.
 void setBigEndian()
           
 void setLittleEndian()
           
 void setSectionHeaderStringTable(Section.StrTabSection shstrtab)
          Sets the section header string table to be the given section.
 void write()
           
(package private)  void writeHeader(int e_phoff, int e_shoff)
           
(package private)  void writeIdent()
           
(package private)  void writeMagicNumber()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Linker.ELF.ELF
read_addr, read_byte, read_bytes, read_half, read_off, read_sword, read_word, set_position, write_addr, write_byte, write_bytes, write_half, write_off, write_sectionname, write_sword, write_word
 

Field Detail

ei_class

protected byte ei_class

ei_data

protected byte ei_data

e_type

protected int e_type

e_machine

protected int e_machine

e_version

protected int e_version

e_entry

protected int e_entry

e_flags

protected int e_flags

program_headers

protected java.util.List program_headers

sections

protected java.util.List sections

section_header_string_table

protected Section.StrTabSection section_header_string_table
Constructor Detail

ELFImpl

public ELFImpl(byte data,
               int type,
               int machine,
               int entry)
Creates new ELFImpl


ELFImpl

protected ELFImpl()
Method Detail

getSectionHeaderStringTable

public Section.StrTabSection getSectionHeaderStringTable()
Description copied from interface: ELF
Returns the section header string table, if one has been defined. Or null otherwise.

Specified by:
getSectionHeaderStringTable in interface ELF

setSectionHeaderStringTable

public void setSectionHeaderStringTable(Section.StrTabSection shstrtab)
Description copied from interface: ELF
Sets the section header string table to be the given section.

Specified by:
setSectionHeaderStringTable in interface ELF

getSectionIndex

public int getSectionIndex(Section s)

getSection

public Section getSection(int i)
Specified by:
getSection in interface ELF

getSections

public java.util.List getSections()
Description copied from interface: ELF
Returns the list of ELF sections in this object.

Specified by:
getSections in interface ELF

addSection

public void addSection(Section s)
Description copied from interface: ELF
Adds the given ELF section to this object.

Specified by:
addSection in interface ELF

removeSection

public void removeSection(Section s)
Description copied from interface: ELF
Removes the given ELF section from this object.

Specified by:
removeSection in interface ELF

addProgramHeader

public void addProgramHeader(ProgramHeader p)
Description copied from interface: ELF
Adds the given ELF program header to this object.

Specified by:
addProgramHeader in interface ELF

removeProgramHeader

public void removeProgramHeader(ProgramHeader p)
Description copied from interface: ELF
Removes the given ELF program header from this object.

Specified by:
removeProgramHeader in interface ELF

isLittleEndian

public boolean isLittleEndian()
Description copied from interface: ELF
Returns true if this ELF object is little-endian.

Specified by:
isLittleEndian in interface ELF

isBigEndian

public boolean isBigEndian()
Description copied from interface: ELF
Returns true if this ELF object is big-endian.

Specified by:
isBigEndian in interface ELF

setLittleEndian

public void setLittleEndian()
Specified by:
setLittleEndian in interface ELF

setBigEndian

public void setBigEndian()
Specified by:
setBigEndian in interface ELF

write

public void write()
           throws java.io.IOException
Specified by:
write in interface ELF

writeHeader

void writeHeader(int e_phoff,
                 int e_shoff)
           throws java.io.IOException

writeIdent

void writeIdent()
          throws java.io.IOException

writeMagicNumber

void writeMagicNumber()
                throws java.io.IOException

getHeaderSize

public static int getHeaderSize()