OpenASIP
2.0
|
#include <TPEFSectionWriter.hh>
Protected Member Functions | |
TPEFSectionWriter () | |
virtual | ~TPEFSectionWriter () |
virtual const BinaryWriter & | parent () const |
virtual void | actualWriteHeader (BinaryStream &stream, const Section *sect) const |
virtual void | actualWriteData (BinaryStream &stream, const Section *sect) const |
virtual Section::SectionType | type () const =0 |
Returns SectionTypet hat actual reader or writer instance can handle. More... | |
virtual void | createKeys (const Section *sect) const |
virtual void | writeSize (BinaryStream &stream, const Section *sect) const |
virtual void | writeInfo (BinaryStream &stream, const Section *sect) const |
virtual SectionId | getSectionId () const |
virtual Word | elementSize (const Section *section) const |
Protected Member Functions inherited from TPEF::SectionWriter | |
SectionWriter () | |
virtual | ~SectionWriter () |
virtual void | finalize (BinaryStream &stream, Section *section) const |
Private Member Functions | |
TPEFSectionWriter (const TPEFSectionWriter &) | |
void | writeBodyStartOffset (BinaryStream &stream, const Section *sect) const |
Additional Inherited Members | |
Static Public Member Functions inherited from TPEF::SectionWriter | |
static void | writeHeader (BinaryStream &stream, const Section *sect, const BinaryWriter *writer) |
static void | writeData (BinaryStream &stream, const Section *sect, const BinaryWriter *writer) |
static void | finalizeBinary (BinaryStream &stream, const Binary *binaryToFinalize, const BinaryWriter *writer) |
Static Protected Member Functions inherited from TPEF::SectionWriter | |
static void | registerSectionWriter (const SectionWriter *sWriter) |
static SectionId | getUniqueSectionId () |
Base class for all TPEF filetype writer classes.
Definition at line 49 of file TPEFSectionWriter.hh.
|
protected |
|
protectedvirtual |
|
private |
|
protectedvirtual |
Empty default implementation of method.
This is used if Section does not contain any data part.
stream | Where to write. |
sect | Data to write. |
Implements TPEF::SectionWriter.
Reimplemented in TPEF::TPEFSymbolSectionWriter, TPEF::TPEFDebugSectionWriter, TPEF::TPEFASpaceSectionWriter, TPEF::TPEFRelocSectionWriter, TPEF::TPEFResourceSectionWriter, TPEF::TPEFLineNumSectionWriter, TPEF::TPEFCodeSectionWriter, TPEF::TPEFDataSectionWriter, and TPEF::TPEFStringSectionWriter.
Definition at line 193 of file TPEFSectionWriter.cc.
|
protectedvirtual |
Writes section's header into stream.
stream | Stream where to write. |
sect | Section to be written. |
Implements TPEF::SectionWriter.
Definition at line 89 of file TPEFSectionWriter.cc.
References TPEF::ReferenceManager::SafePointer::addObjectReference(), TPEF::Section::aSpace(), assert, createKeys(), elementSize(), TPEF::Section::flags(), getSectionId(), TPEF::Section::isProgramSection(), TPEF::Section::link(), TPEF::Section::name(), TPEF::Section::noBits(), TPEF::ValueReplacer::resolve(), TPEF::BinaryStream::setWritePosition(), TPEF::TPEFHeaders::SH_ADDR, TPEF::TPEFHeaders::SH_ASPACE, TPEF::TPEFHeaders::SH_ENTSIZE, TPEF::TPEFHeaders::SH_FLAGS, TPEF::TPEFHeaders::SH_ID, TPEF::TPEFHeaders::SH_INFO, TPEF::TPEFHeaders::SH_LINK, TPEF::TPEFHeaders::SH_NAME, TPEF::TPEFHeaders::SH_OFFSET, TPEF::TPEFHeaders::SH_PADDING, TPEF::TPEFHeaders::SH_SIZE, TPEF::TPEFHeaders::SH_TYPE, TPEF::Section::ST_NULL, TPEF::Section::startingAddress(), TPEF::Section::type(), TPEF::Section::vLen(), writeBodyStartOffset(), TPEF::BinaryStream::writeByte(), TPEF::BinaryStream::writeHalfWord(), writeInfo(), TPEF::BinaryStream::writePosition(), writeSize(), and TPEF::BinaryStream::writeWord().
|
protectedvirtual |
Fall through method for creating reference keys.
This method is used for those sections, whose elements can be referred, but there is no section body stored in TPEF binary (if section has no bits flag set, then this method is invoked instead writeData).
Empty implementation for sections that don't need keys created if section do not have body.
sect | Section which for keys will be created. |
Reimplemented in TPEF::TPEFUDataSectionWriter, TPEF::TPEFSymbolSectionWriter, and TPEF::TPEFDebugSectionWriter.
Definition at line 286 of file TPEFSectionWriter.cc.
Referenced by actualWriteHeader().
|
protectedvirtual |
Returns fixed element size of section.
sect | Data to write. |
Reimplemented in TPEF::TPEFSymbolSectionWriter, TPEF::TPEFDataSectionWriter, TPEF::TPEFDebugSectionWriter, TPEF::TPEFUDataSectionWriter, TPEF::TPEFASpaceSectionWriter, TPEF::TPEFRelocSectionWriter, TPEF::TPEFResourceSectionWriter, TPEF::TPEFLineNumSectionWriter, TPEF::TPEFStringSectionWriter, and TPEF::TPEFNullSectionWriter.
Definition at line 204 of file TPEFSectionWriter.cc.
Referenced by actualWriteHeader().
|
protectedvirtual |
Get section identification code for the section.
Reimplemented in TPEF::TPEFNullSectionWriter.
Definition at line 268 of file TPEFSectionWriter.cc.
References TPEF::SectionWriter::getUniqueSectionId().
Referenced by actualWriteHeader().
|
protectedvirtual |
Returns binary writer which for section writers are created.
Implements TPEF::SectionWriter.
Definition at line 78 of file TPEFSectionWriter.cc.
References TPEF::TPEFWriter::instance().
|
protectedpure virtual |
Returns SectionTypet hat actual reader or writer instance can handle.
Implements TPEF::SectionWriter.
Implemented in TPEF::TPEFUDataSectionWriter, TPEF::TPEFCodeSectionWriter, TPEF::TPEFDataSectionWriter, TPEF::TPEFASpaceSectionWriter, TPEF::TPEFRelocSectionWriter, TPEF::TPEFResourceSectionWriter, TPEF::TPEFStringSectionWriter, TPEF::TPEFSymbolSectionWriter, TPEF::TPEFDebugSectionWriter, TPEF::TPEFLineNumSectionWriter, TPEF::TPEFNullSectionWriter, and TPEF::TPEFLEDataSectionWriter.
|
private |
Writes Section's data area offset into stream.
stream | Stream where to write. |
sect | Section which data's offset to write. |
Definition at line 245 of file TPEFSectionWriter.cc.
References TPEF::Section::chunk(), TPEF::Section::element(), TPEF::Section::isChunkable(), TPEF::Section::noBits(), TPEF::ValueReplacer::resolve(), and TPEF::BinaryStream::writeWord().
Referenced by actualWriteHeader().
|
protectedvirtual |
Writes section info field into stream.
Default implementation writes, there zero word.
stream | Stream where to write. |
sect | Section which info field to write. |
Reimplemented in TPEF::TPEFRelocSectionWriter, TPEF::TPEFCodeSectionWriter, and TPEF::TPEFLineNumSectionWriter.
Definition at line 233 of file TPEFSectionWriter.cc.
References TPEF::BinaryStream::writeWord().
Referenced by actualWriteHeader().
|
protectedvirtual |
Writes section size field in to stream.
Default implementation, which uses replacer class to write size.
stream | Stream, where to write. |
sect | Section which size to write. |
Reimplemented in TPEF::TPEFUDataSectionWriter, and TPEF::TPEFNullSectionWriter.
Definition at line 218 of file TPEFSectionWriter.cc.
References TPEF::ValueReplacer::resolve().
Referenced by actualWriteHeader().