Go to the documentation of this file.
36 #include "boost/format.hpp"
64 using ReferenceManager::SafePointer;
65 using ReferenceManager::SectionKey;
66 using ReferenceManager::SectionIndexKey;
67 using ReferenceManager::SectionOffsetKey;
115 assert(relocSection != NULL);
126 while (elementStart +
header().elementSize <=
142 elem->
setSymbol(CREATE_SAFEPOINTER(indexKey));
156 elem->
setASpace(CREATE_SAFEPOINTER(aSpaceIndexKey));
185 dynamic_cast<RelocSection*
>(section)->referencedSection();
213 if (neededBits > elem->
size()) {
217 "Destination address width %d of relocation is "
218 "bigger than the field size %d.")
219 % neededBits % elem->
size()).str());
222 address = imm->
word();
238 for (
int i = 0; i < elem->
size() / mauSize; i++) {
239 address = address << mauSize;
240 address = address | dataSect->
MAU(startIndex+i);
244 bool requestedChunkWasOutOfRange =
false;
245 assert(requestedChunkWasOutOfRange);
261 for (
int i = 0; i < elem->
size() / mauSize; i++) {
262 address |= (dataSect->
MAU(startIndex+i) << (mauSize*i));
266 bool requestedChunkWasOutOfRange =
false;
267 assert(requestedChunkWasOutOfRange);
273 bool referencedSectionMustBeEitherCodeOrData =
false;
274 assert(referencedSectionMustBeEitherCodeOrData);
291 assert(destSection != NULL);
308 Word instructionNumber =
320 ceil(
static_cast<double>(elem->
aSpace()->
MAU()) /
324 sectOffsetOfElement =
351 dynamic_cast<RelocSection*
>(sect)->setReferencedSection(
352 CREATE_SAFEPOINTER(sKey));
354 bool referencedSectionOfRelocationMustNotBeNullSection =
false;
355 assert(referencedSectionOfRelocationMustNotBeNullSection);
HalfWord SectionId
Type for storing binary file section ids.
ASpaceElement * aSpace() const
virtual MinimumAddressableUnit MAU(Word index) const
void readInfo(BinaryStream &stream, Section *sect) const
void setReadPosition(unsigned int position)
ASpaceSection * aSpaceSection() const
static SectionId refSectionId_
Section id of last referenced section.
virtual void readData(BinaryStream &stream, Section *section) const
virtual SectionType type() const =0
Returns SectioType of actual section instance.
virtual void finalize(Section *section) const
bool isUndefined(ASpaceElement *aSpace) const
SectionId sectionId() const
static void addObjectReference(SectionIndexKey key, const SafePointable *obj)
static TPEFRelocSectionReader proto_
Prototype instance of TPEFRelocSectionReader to be registered to SectionReader.
SectionElement * element(Word index) const
#define assert(condition)
virtual ~TPEFRelocSectionReader()
virtual void addElement(SectionElement *element)
Section * sectionOfAddress(const ASpaceElement *aSpaceId, AddressImage address) const
ASpaceElement * aSpace() const
@ ST_DATA
Initialized data section.
void setType(RelocType aType)
@ ST_LEDATA
Initialized little endian data section.
static AddressImage absoluteAddress(AddressImage relocationValue, RelocElement::RelocType relocType)
static SectionKey sectionKeyFor(const SafePointable *obj)
void setChunked(bool isChunked)
void setSymbol(SymbolElement *aSymbol)
static void registerSectionReader(const SectionReader *sReader)
void setLocation(SectionElement *aLocation)
virtual Section::SectionType type() const
UInt32 AddressImage
Type for storing addresses to memory image.
virtual BinaryReader * parent() const
Word SectionOffset
Type for storing offsets relative to a given base offset value.
virtual void readData(BinaryStream &stream, Section *section) const
void setBitOffset(Byte anOffset)
@ ST_RELOC
Relocation section.
void setASpace(ASpaceElement *anASpace)
void setDestination(SectionElement *aDestination)
SectionElement * location() const
Word SectionIndex
Type for storing section indexes.
virtual bool isCodeSection() const
AddressImage startingAddress() const
virtual Word chunkToMAUIndex(const Chunk *chunk) const
Word elementCount() const
static const Header & header()