joeq.Bootstrap
Class SinglePassBootImage

java.lang.Object
  extended by joeq.Bootstrap.SinglePassBootImage
All Implemented Interfaces:
ELFConstants

public class SinglePassBootImage
extends Object
implements ELFConstants

SinglePassBootImage

Version:
$Id: SinglePassBootImage.java,v 1.2 2004/09/30 03:35:29 joewhaley Exp $
Author:
John Whaley

Field Summary
static jq_StaticField _DEFAULT
           
 Set boot_types
           
static byte C_ARG
           
static byte C_AUTO
           
static byte C_AUTOARG
           
static byte C_BLOCK
           
static byte C_EFCN
           
static byte C_ENTAG
           
static byte C_EOS
           
static byte C_EXT
           
static byte C_EXTDEF
           
static byte C_FCN
           
static byte C_FIELD
           
static byte C_FILE
           
static byte C_LABEL
           
static byte C_LASTENT
           
static byte C_MOE
           
static byte C_MOS
           
static byte C_MOU
           
static byte C_NULL
           
static byte C_REG
           
static byte C_REGPARM
           
static byte C_SECTION
           
static byte C_STAT
           
static byte C_STRTAG
           
static byte C_TPDEF
           
static byte C_ULABEL
           
static byte C_UNTAG
           
static byte C_USTATIC
           
static byte C_WEAKEXT
           
static SinglePassBootImage DEFAULT
           
static char DT_ARY
           
static char DT_FCN
           
static char DT_NON
           
static char DT_PTR
           
static char F_AR32WR
           
static char F_EXEC
           
static char F_LNNO
           
static char F_LSYMS
           
static char F_RELFLG
           
static boolean IGNORE_UNKNOWN_OBJECTS
           
static int MAX_HEAP
           
static short N_ABS
           
static short N_DEBUG
           
static short N_UNDEF
           
static int NUM_OF_EXTERNAL_SYMS
           
static PrintStream out
           
static char RELOC_ADDR32
           
static char RELOC_REL32
           
static int STYP_BSS
           
static int STYP_DATA
           
static int STYP_EXEC
           
static int STYP_READ
           
static int STYP_RELOV
           
static int STYP_TEXT
           
static int STYP_WRITE
           
static char T_CHAR
           
static char T_DOUBLE
           
static char T_ENUM
           
static char T_FLOAT
           
static char T_INT
           
static char T_LNGDBL
           
static char T_LONG
           
static char T_MOE
           
static char T_NULL
           
static char T_SHORT
           
static char T_STRUCT
           
static char T_UCHAR
           
static char T_UINT
           
static char T_ULONG
           
static char T_UNION
           
static char T_USHORT
           
static char T_VOID
           
 Collection toReinitialize
           
static boolean TRACE
           
static int UPDATE_PERIOD
           
static boolean USE_MICROSOFT_STYLE_MUNGE
           
 
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
SinglePassBootImage(BootstrapCodeAllocator bca)
           
SinglePassBootImage(BootstrapCodeAllocator bca, int initialCapacity)
           
SinglePassBootImage(BootstrapCodeAllocator bca, int initialCapacity, float loadFactor)
           
 
Method Summary
 void addCodeReloc(HeapAddress addr, CodeAddress target)
           
 void addDataReloc(HeapAddress addr, HeapAddress target)
           
 HeapAddress addressOf(Object o)
           
 void addStaticFieldReloc(jq_StaticField f)
           
 void addStaticFieldRelocs(jq_Class k)
           
 void addSystemInterfaceRelocs_COFF(Collection extref, Collection dataRelocs)
           
 void addSystemInterfaceRelocs_ELF(Collection extref, Collection dataRelocs)
           
 int addVTableRelocs(Collection list)
           
 void disableAllocations()
           
 void dumpCOFF(FileChannel fc, jq_StaticMethod rootm)
           
 void dumpDATASCNHDR(ByteBuffer out, int scnptr, int size, int nreloc)
           
 void dumpELF(FileChannel fc, jq_StaticMethod rootm)
           
 void dumpEXTDEFSYMENTs(ByteBuffer out, List extrefs)
           
 void dumpEXTSYMENTs(ByteBuffer out, jq_StaticMethod rootm)
           
 void dumpFILHDR(ByteBuffer out, int symptr, int nsyms)
           
 void dumpMETHODSYMENT(ByteBuffer out, jq_CompiledCode cc)
           
 void dumpSECTIONSYMENTs(ByteBuffer out)
           
 void dumpTEXTSCNHDR(ByteBuffer out, int size, int nreloc)
           
 void enableAllocations()
           
 HeapAddress getAddressOf(HeapAddress from, Object to)
           
 HeapAddress getOrAllocateObject(Object o)
           
 void handleForwardReferences()
           
 HeapAddress initializeObject(Object o)
           
 void initStaticData(jq_Class k)
           
 void initStaticField(jq_StaticField f)
           
 void initStaticFields(jq_Class k)
           
 void initVTable(jq_Reference t)
           
 void invokeclinit(jq_Class c)
           
 HeapAddress isInitialized(Object o)
           
 void layoutObject(Object o, HeapAddress addr, boolean addReloc)
           
 int numOfEntries()
           
 void reinitializeObjects()
           
 int size()
           
static void write_bytes(ByteBuffer out, String s, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_HEAP

public static int MAX_HEAP

TRACE

public static boolean TRACE

out

public static final PrintStream out

DEFAULT

public static final SinglePassBootImage DEFAULT

boot_types

public Set boot_types

toReinitialize

public final Collection toReinitialize

IGNORE_UNKNOWN_OBJECTS

public static boolean IGNORE_UNKNOWN_OBJECTS

UPDATE_PERIOD

public static int UPDATE_PERIOD

F_RELFLG

public static final char F_RELFLG
See Also:
Constant Field Values

F_EXEC

public static final char F_EXEC
See Also:
Constant Field Values

F_LNNO

public static final char F_LNNO
See Also:
Constant Field Values

F_LSYMS

public static final char F_LSYMS
See Also:
Constant Field Values

F_AR32WR

public static final char F_AR32WR
See Also:
Constant Field Values

STYP_TEXT

public static final int STYP_TEXT
See Also:
Constant Field Values

STYP_DATA

public static final int STYP_DATA
See Also:
Constant Field Values

STYP_BSS

public static final int STYP_BSS
See Also:
Constant Field Values

STYP_RELOV

public static final int STYP_RELOV
See Also:
Constant Field Values

STYP_EXEC

public static final int STYP_EXEC
See Also:
Constant Field Values

STYP_READ

public static final int STYP_READ
See Also:
Constant Field Values

STYP_WRITE

public static final int STYP_WRITE
See Also:
Constant Field Values

RELOC_ADDR32

public static final char RELOC_ADDR32
See Also:
Constant Field Values

RELOC_REL32

public static final char RELOC_REL32
See Also:
Constant Field Values

N_UNDEF

public static final short N_UNDEF
See Also:
Constant Field Values

N_ABS

public static final short N_ABS
See Also:
Constant Field Values

N_DEBUG

public static final short N_DEBUG
See Also:
Constant Field Values

T_NULL

public static final char T_NULL
See Also:
Constant Field Values

T_VOID

public static final char T_VOID
See Also:
Constant Field Values

T_CHAR

public static final char T_CHAR
See Also:
Constant Field Values

T_SHORT

public static final char T_SHORT
See Also:
Constant Field Values

T_INT

public static final char T_INT
See Also:
Constant Field Values

T_LONG

public static final char T_LONG
See Also:
Constant Field Values

T_FLOAT

public static final char T_FLOAT
See Also:
Constant Field Values

T_DOUBLE

public static final char T_DOUBLE
See Also:
Constant Field Values

T_STRUCT

public static final char T_STRUCT
See Also:
Constant Field Values

T_UNION

public static final char T_UNION
See Also:
Constant Field Values

T_ENUM

public static final char T_ENUM
See Also:
Constant Field Values

T_MOE

public static final char T_MOE
See Also:
Constant Field Values

T_UCHAR

public static final char T_UCHAR
See Also:
Constant Field Values

T_USHORT

public static final char T_USHORT
See Also:
Constant Field Values

T_UINT

public static final char T_UINT
See Also:
Constant Field Values

T_ULONG

public static final char T_ULONG
See Also:
Constant Field Values

T_LNGDBL

public static final char T_LNGDBL
See Also:
Constant Field Values

DT_NON

public static final char DT_NON
See Also:
Constant Field Values

DT_PTR

public static final char DT_PTR
See Also:
Constant Field Values

DT_FCN

public static final char DT_FCN
See Also:
Constant Field Values

DT_ARY

public static final char DT_ARY
See Also:
Constant Field Values

C_NULL

public static final byte C_NULL
See Also:
Constant Field Values

C_AUTO

public static final byte C_AUTO
See Also:
Constant Field Values

C_EXT

public static final byte C_EXT
See Also:
Constant Field Values

C_STAT

public static final byte C_STAT
See Also:
Constant Field Values

C_REG

public static final byte C_REG
See Also:
Constant Field Values

C_EXTDEF

public static final byte C_EXTDEF
See Also:
Constant Field Values

C_LABEL

public static final byte C_LABEL
See Also:
Constant Field Values

C_ULABEL

public static final byte C_ULABEL
See Also:
Constant Field Values

C_MOS

public static final byte C_MOS
See Also:
Constant Field Values

C_ARG

public static final byte C_ARG
See Also:
Constant Field Values

C_STRTAG

public static final byte C_STRTAG
See Also:
Constant Field Values

C_MOU

public static final byte C_MOU
See Also:
Constant Field Values

C_UNTAG

public static final byte C_UNTAG
See Also:
Constant Field Values

C_TPDEF

public static final byte C_TPDEF
See Also:
Constant Field Values

C_USTATIC

public static final byte C_USTATIC
See Also:
Constant Field Values

C_ENTAG

public static final byte C_ENTAG
See Also:
Constant Field Values

C_MOE

public static final byte C_MOE
See Also:
Constant Field Values

C_REGPARM

public static final byte C_REGPARM
See Also:
Constant Field Values

C_FIELD

public static final byte C_FIELD
See Also:
Constant Field Values

C_AUTOARG

public static final byte C_AUTOARG
See Also:
Constant Field Values

C_LASTENT

public static final byte C_LASTENT
See Also:
Constant Field Values

C_BLOCK

public static final byte C_BLOCK
See Also:
Constant Field Values

C_FCN

public static final byte C_FCN
See Also:
Constant Field Values

C_EOS

public static final byte C_EOS
See Also:
Constant Field Values

C_FILE

public static final byte C_FILE
See Also:
Constant Field Values

C_SECTION

public static final byte C_SECTION
See Also:
Constant Field Values

C_WEAKEXT

public static final byte C_WEAKEXT
See Also:
Constant Field Values

C_EFCN

public static final byte C_EFCN
See Also:
Constant Field Values

USE_MICROSOFT_STYLE_MUNGE

public static boolean USE_MICROSOFT_STYLE_MUNGE

NUM_OF_EXTERNAL_SYMS

public static final int NUM_OF_EXTERNAL_SYMS
See Also:
Constant Field Values

_DEFAULT

public static final jq_StaticField _DEFAULT
Constructor Detail

SinglePassBootImage

public SinglePassBootImage(BootstrapCodeAllocator bca,
                           int initialCapacity,
                           float loadFactor)

SinglePassBootImage

public SinglePassBootImage(BootstrapCodeAllocator bca,
                           int initialCapacity)

SinglePassBootImage

public SinglePassBootImage(BootstrapCodeAllocator bca)
Method Detail

addressOf

public final HeapAddress addressOf(Object o)

addCodeReloc

public final void addCodeReloc(HeapAddress addr,
                               CodeAddress target)

addDataReloc

public final void addDataReloc(HeapAddress addr,
                               HeapAddress target)

invokeclinit

public final void invokeclinit(jq_Class c)

enableAllocations

public void enableAllocations()

disableAllocations

public void disableAllocations()

isInitialized

public HeapAddress isInitialized(Object o)

initializeObject

public HeapAddress initializeObject(Object o)

getOrAllocateObject

public HeapAddress getOrAllocateObject(Object o)

getAddressOf

public HeapAddress getAddressOf(HeapAddress from,
                                Object to)

initStaticField

public void initStaticField(jq_StaticField f)

initStaticFields

public void initStaticFields(jq_Class k)

initStaticData

public void initStaticData(jq_Class k)

addStaticFieldRelocs

public void addStaticFieldRelocs(jq_Class k)

addStaticFieldReloc

public void addStaticFieldReloc(jq_StaticField f)

initVTable

public void initVTable(jq_Reference t)

numOfEntries

public int numOfEntries()

layoutObject

public void layoutObject(Object o,
                         HeapAddress addr,
                         boolean addReloc)

reinitializeObjects

public void reinitializeObjects()

size

public int size()

handleForwardReferences

public void handleForwardReferences()

dumpFILHDR

public void dumpFILHDR(ByteBuffer out,
                       int symptr,
                       int nsyms)
                throws IOException
Throws:
IOException

dumpTEXTSCNHDR

public void dumpTEXTSCNHDR(ByteBuffer out,
                           int size,
                           int nreloc)
                    throws IOException
Throws:
IOException

dumpDATASCNHDR

public void dumpDATASCNHDR(ByteBuffer out,
                           int scnptr,
                           int size,
                           int nreloc)
                    throws IOException
Throws:
IOException

dumpSECTIONSYMENTs

public void dumpSECTIONSYMENTs(ByteBuffer out)
                        throws IOException
Throws:
IOException

dumpEXTSYMENTs

public void dumpEXTSYMENTs(ByteBuffer out,
                           jq_StaticMethod rootm)
                    throws IOException
Throws:
IOException

dumpEXTDEFSYMENTs

public void dumpEXTDEFSYMENTs(ByteBuffer out,
                              List extrefs)
                       throws IOException
Throws:
IOException

dumpMETHODSYMENT

public void dumpMETHODSYMENT(ByteBuffer out,
                             jq_CompiledCode cc)
                      throws IOException
Throws:
IOException

addSystemInterfaceRelocs_COFF

public void addSystemInterfaceRelocs_COFF(Collection extref,
                                          Collection dataRelocs)

addSystemInterfaceRelocs_ELF

public void addSystemInterfaceRelocs_ELF(Collection extref,
                                         Collection dataRelocs)

addVTableRelocs

public int addVTableRelocs(Collection list)

dumpCOFF

public void dumpCOFF(FileChannel fc,
                     jq_StaticMethod rootm)
              throws IOException
Throws:
IOException

write_bytes

public static void write_bytes(ByteBuffer out,
                               String s,
                               int len)
                        throws IOException
Throws:
IOException

dumpELF

public void dumpELF(FileChannel fc,
                    jq_StaticMethod rootm)
             throws IOException
Throws:
IOException


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