joeq.Linker.ELF
Class Section

java.lang.Object
  extended by joeq.Linker.ELF.Section
All Implemented Interfaces:
ELFConstants
Direct Known Subclasses:
Section.DynamicSection, Section.DynSymSection, Section.FakeSection, Section.HashSection, Section.NoBitsSection, Section.NoteSection, Section.NullSection, Section.ProgBitsSection, Section.RelASection, Section.RelSection, Section.StrTabSection, Section.SymTabSection

public abstract class Section
extends Object
implements ELFConstants

Defines a section in an ELF file.

Version:
$Id: Section.java,v 1.23 2004/09/30 03:35:33 joewhaley Exp $
Author:
John Whaley

Nested Class Summary
static class Section.AbsSection
           
static class Section.DynamicSection
           
static class Section.DynSymSection
           
static class Section.FakeSection
           
static class Section.HashSection
           
static class Section.NoBitsSection
           
static class Section.NoteSection
           
static class Section.NullSection
           
static class Section.ProgBitsSection
           
static class Section.ProgBitsSectionImpl
           
static class Section.RelASection
           
static class Section.RelSection
           
static class Section.StrTabSection
           
static class Section.SymTabSection
           
static class Section.UnloadedSection
           
 
Field Summary
protected  int addr
           
static String DEFAULT_ENCODING
           
protected  int flags
           
protected  int index
           
protected  String name
           
 
Fields inherited from interface joeq.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 Section(int flags, int addr)
           
protected Section(String name, int flags, int addr)
          Creates new Section
 
Method Summary
 void clearAlloc()
           
 void clearExecInstr()
           
 void clearWrite()
           
 int getAddr()
           
abstract  int getAddrAlign()
           
abstract  int getEntSize()
           
 int getFlags()
           
static int getHeaderSize()
           
 int getIndex()
           
abstract  int getInfo()
           
abstract  int getLink()
           
 String getName()
           
abstract  int getSize()
           
abstract  int getType()
           
abstract  void load(Section.UnloadedSection s, ELF file)
           
 void setAddr(int addr)
           
 void setAlloc()
           
 void setExecInstr()
           
 void setIndex(int index)
           
 void setName(String name)
           
 void setWrite()
           
abstract  void writeData(ELF file)
           
 void writeHeader(ELF file, int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
See Also:
Constant Field Values

name

protected String name

index

protected int index

flags

protected int flags

addr

protected int addr
Constructor Detail

Section

protected Section(String name,
                  int flags,
                  int addr)
Creates new Section


Section

protected Section(int flags,
                  int addr)
Method Detail

getIndex

public int getIndex()

getName

public String getName()

getType

public abstract int getType()

getFlags

public int getFlags()

getAddr

public int getAddr()

getSize

public abstract int getSize()

getLink

public abstract int getLink()

getInfo

public abstract int getInfo()

getAddrAlign

public abstract int getAddrAlign()

getEntSize

public abstract int getEntSize()

setIndex

public void setIndex(int index)

setName

public void setName(String name)

setAddr

public void setAddr(int addr)

setWrite

public void setWrite()

clearWrite

public void clearWrite()

setAlloc

public void setAlloc()

clearAlloc

public void clearAlloc()

setExecInstr

public void setExecInstr()

clearExecInstr

public void clearExecInstr()

writeHeader

public void writeHeader(ELF file,
                        int offset)
                 throws IOException
Throws:
IOException

writeData

public abstract void writeData(ELF file)
                        throws IOException
Throws:
IOException

load

public abstract void load(Section.UnloadedSection s,
                          ELF file)
                   throws IOException
Throws:
IOException

getHeaderSize

public static int getHeaderSize()


Copyright © 2001-2005 John Whaley. All Rights Reserved.