public class ELFObjectFile extends ObjectFile
| Modifier and Type | Class and Description |
|---|---|
static class |
ELFObjectFile.ELFClass
File class: 32 or 64 bit.
|
static class |
ELFObjectFile.ELFEncoding
Encoding: little endian or big endian.
|
class |
ELFObjectFile.ELFHeader
Representation of an ELF binary header.
|
static class |
ELFObjectFile.ELFOsAbi
ABI encoding.
|
class |
ELFObjectFile.ELFSection |
static class |
ELFObjectFile.ELFSectionFlag |
static class |
ELFObjectFile.ELFSegmentFlag |
static class |
ELFObjectFile.ELFType
ELF file type.
|
protected class |
ELFObjectFile.SectionHeaderStrtab
This class implements the shstrtab section.
|
class |
ELFObjectFile.SectionHeaderTable
ELF's section header table (SHT) is an element which indexes and summarises the contents of
the file.
|
static class |
ELFObjectFile.SectionType
ELF section type.
|
static class |
ELFObjectFile.SegmentType |
ObjectFile.Element, ObjectFile.ElementComparatorByDecidedOffset, ObjectFile.Format, ObjectFile.Header, ObjectFile.IntegerDecisionComparator, ObjectFile.NobitsSectionImpl, ObjectFile.ProgbitsSectionImpl, ObjectFile.RelocatableSectionImpl, ObjectFile.RelocationKind, ObjectFile.RelocationMethod, ObjectFile.RelocationRecord, ObjectFile.RelocationSiteInfo, ObjectFile.Section, ObjectFile.Segment, ObjectFile.SizeTiebreakComparator, ObjectFile.Symbol, ObjectFile.ValueEnum| Modifier and Type | Field and Description |
|---|---|
static int |
IDENT_LENGTH |
static char[] |
IDENT_MAGIC |
protected ELFObjectFile.ELFSection |
interp |
elements, nameForElement| Constructor and Description |
|---|
ELFObjectFile() |
ELFObjectFile(boolean runtimeDebugInfoGeneration) |
ELFObjectFile(ELFMachine machine) |
ELFObjectFile(ELFMachine machine,
boolean runtimeDebugInfoGeneration) |
| Modifier and Type | Method and Description |
|---|---|
ObjectFile.Symbol |
createDefinedSymbol(String name,
ObjectFile.Element baseSection,
long position,
int size,
boolean isCode,
boolean isGlobal) |
protected ELFSymtab |
createSymbolTable() |
ObjectFile.Symbol |
createUndefinedSymbol(String name,
int size,
boolean isCode) |
protected boolean |
elementsCanSharePage(ObjectFile.Element s1,
ObjectFile.Element s2,
int off1,
int off2)
Returns whether, according to the semantics of the object file, two sections could reasonably
both be placed (partially) on the same page-sized region of virtual memory.
|
int |
getAbiVersion() |
ByteOrder |
getByteOrder() |
ELFObjectFile.ELFEncoding |
getDataEncoding() |
ELFObjectFile.ELFClass |
getFileClass() |
long |
getFlags() |
ObjectFile.Format |
getFormat() |
int |
getIndexForSection(ELFObjectFile.ELFSection s) |
ELFMachine |
getMachine() |
protected int |
getMinimumFileSize() |
ELFRelocationSection |
getOrCreateDynamicRelocSection(ELFSymtab syms,
boolean withExplicitAddends) |
ELFRelocationSection |
getOrCreateRelocSection(ELFUserDefinedSection elfUserDefinedSection,
ELFSymtab syms,
boolean withExplicitAddends) |
protected ObjectFile.Segment |
getOrCreateSegment(String maybeSegmentName,
String sectionName,
boolean writable,
boolean executable)
Return a Segment object which is appropriate for containing a section of the given name, if
such a segment is mandatory according to the object file format specification.
|
ELFObjectFile.ELFOsAbi |
getOsAbi() |
ELFObjectFile.ELFSection |
getSectionByIndex(int i) |
Set<ObjectFile.Segment> |
getSegments() |
SymbolTable |
getSymbolTable() |
char |
getVersion() |
int |
getWordSizeInBytes() |
ELFNobitsSection |
newNobitsSection(ObjectFile.Segment segment,
String name,
ObjectFile.NobitsSectionImpl impl) |
ELFProgbitsSection |
newProgbitsSection(ObjectFile.Segment segment,
String name,
int alignment,
boolean writable,
boolean executable,
ObjectFile.ProgbitsSectionImpl impl) |
ELFUserDefinedSection |
newUserDefinedSection(ObjectFile.Segment segment,
String name,
int alignment,
ElementImpl impl)
Create a new section for holding user data.
|
void |
setByteOrder(ByteOrder byteOrder) |
void |
setFileClass(ELFObjectFile.ELFClass fileClass) |
void |
setMachine(ELFMachine machine) |
void |
setMainEntryPoint(String name) |
boolean |
shouldRecordDebugRelocations()
Determines whether references between debug sections should be recorded for relocation.
|
allDecisions, bake, basicDependencies, createElementList, createRuntimeDebugInfo, decisionsByKind, defaultDecisions, defaultDependencies, defaultGetOrDecide, defaultGetOrDecideContent, defaultGetOrDecideOffset, defaultGetOrDecideSize, defaultGetOrDecideVaddr, elementForName, elementsMappedOnPage, findSegmentByName, flagSetAsLong, flagSetFromLong, getDecisionsByElement, getDecisionsTaken, getElements, getFilenameSuffix, getHeader, getHostPageSize, getNativeFormat, getNativeObjectFile, getOffsetBootstrapElement, getOrCreateSymbolTable, getPageSize, getPageSizeShift, getSections, greatestCommonDivisor, initialVaddr, lowestCommonMultiple, maximalDecisionValues, minimalDecisionValues, minimalDependencies, nameForElement, newDebugSection, newNobitsSection, newProgbitsSection, newUserDefinedSection, nextAvailableOffset, nextAvailableVaddr, nextIntegerMultiple, nextIntegerMultipleWithCongruence, roundUpToPageSize, setPageSize, sortedDecisionValues, write, writeBufferpublic static final int IDENT_LENGTH
public static final char[] IDENT_MAGIC
protected ELFObjectFile.ELFSection interp
public ELFObjectFile(ELFMachine machine, boolean runtimeDebugInfoGeneration)
public ELFObjectFile(ELFMachine machine)
public ELFObjectFile()
public ELFObjectFile(boolean runtimeDebugInfoGeneration)
public ObjectFile.Format getFormat()
getFormat in class ObjectFilepublic void setFileClass(ELFObjectFile.ELFClass fileClass)
public void setMainEntryPoint(String name)
setMainEntryPoint in class ObjectFileprotected ELFSymtab createSymbolTable()
createSymbolTable in class ObjectFilepublic ObjectFile.Symbol createDefinedSymbol(String name, ObjectFile.Element baseSection, long position, int size, boolean isCode, boolean isGlobal)
createDefinedSymbol in class ObjectFilepublic ObjectFile.Symbol createUndefinedSymbol(String name, int size, boolean isCode)
createUndefinedSymbol in class ObjectFileprotected ObjectFile.Segment getOrCreateSegment(String maybeSegmentName, String sectionName, boolean writable, boolean executable)
ObjectFilegetOrCreateSegment in class ObjectFilemaybeSegmentName - either null, or the name of a segment which the caller would prefer
should contain the given section (in the case where multiple names would be
possible for the created segment, so the choice would be ambiguous)sectionName - a platform-dependent section namewritable - whether the segment contents should be writableexecutable - whether the segment contents should be executablepublic ELFUserDefinedSection newUserDefinedSection(ObjectFile.Segment segment, String name, int alignment, ElementImpl impl)
ObjectFilenewUserDefinedSection in class ObjectFilepublic ELFProgbitsSection newProgbitsSection(ObjectFile.Segment segment, String name, int alignment, boolean writable, boolean executable, ObjectFile.ProgbitsSectionImpl impl)
newProgbitsSection in class ObjectFilepublic ELFNobitsSection newNobitsSection(ObjectFile.Segment segment, String name, ObjectFile.NobitsSectionImpl impl)
newNobitsSection in class ObjectFilepublic ELFObjectFile.ELFSection getSectionByIndex(int i)
public int getIndexForSection(ELFObjectFile.ELFSection s)
protected boolean elementsCanSharePage(ObjectFile.Element s1, ObjectFile.Element s2, int off1, int off2)
ObjectFileelementsCanSharePage in class ObjectFiles1 - one sections2 - another sectionpublic Set<ObjectFile.Segment> getSegments()
getSegments in class ObjectFilepublic ELFObjectFile.ELFEncoding getDataEncoding()
public ByteOrder getByteOrder()
getByteOrder in class ObjectFilepublic void setByteOrder(ByteOrder byteOrder)
setByteOrder in class ObjectFilepublic char getVersion()
public ELFObjectFile.ELFOsAbi getOsAbi()
public int getAbiVersion()
public ELFObjectFile.ELFClass getFileClass()
public int getWordSizeInBytes()
getWordSizeInBytes in class ObjectFilepublic boolean shouldRecordDebugRelocations()
ObjectFileshouldRecordDebugRelocations in class ObjectFilepublic ELFMachine getMachine()
public void setMachine(ELFMachine machine)
public long getFlags()
public ELFRelocationSection getOrCreateDynamicRelocSection(ELFSymtab syms, boolean withExplicitAddends)
public ELFRelocationSection getOrCreateRelocSection(ELFUserDefinedSection elfUserDefinedSection, ELFSymtab syms, boolean withExplicitAddends)
public SymbolTable getSymbolTable()
getSymbolTable in class ObjectFileprotected int getMinimumFileSize()
getMinimumFileSize in class ObjectFile