Go to the documentation of this file.
55 using ReferenceManager::SectionOffsetKey;
56 using ReferenceManager::SectionIndexKey;
57 using ReferenceManager::SafePointer;
107 assert(aOutReader != NULL);
112 assert(relocSection != NULL);
115 assert(refSection != NULL);
129 string msg =
"Relocating something else than text or data section";
173 Word secondWord = stream.
readWord();
188 if (r_addend == 0 &&
checkIfExtern(secondWord) && secondWord != 1026) {
190 elem->
setSymbol(CREATE_SAFEPOINTER(indexKey));
195 elem->
setSymbol(CREATE_SAFEPOINTER(undefSym));
227 dynamic_cast<RelocSection*
>(section)->referencedSection();
230 assert(aOutReader != NULL);
268 if (dataChunk->
offset() +
sizeof(destAddress) >
270 bool requestedChunkWasOutOfRange =
false;
271 assert(requestedChunkWasOutOfRange);
278 mauIndex, 4,
static_cast<unsigned long>(destAddress));
281 bool referencedSectionMustBeEitherCodeOrData =
false;
282 assert(referencedSectionMustBeEitherCodeOrData);
300 switch (aOutRelocType) {
308 bool unknownAOutRelocationType =
false;
309 assert(unknownAOutRelocationType);
HalfWord SectionId
Type for storing binary file section ids.
unsigned int readPosition()
static const int OFFSET_TO_IMMEDIATE_VALUE
virtual SectionType type() const =0
Returns SectioType of actual section instance.
static const Byte RELOCATION_TYPE_MASK
Mask for extracting relocation type.
Section * referencedSection() const
AddressImage addressOfElement(SectionElement *elem) const
void initializeRelocElement(BinaryStream &stream, RelocElement *elem, SectionId refSectionID, AOutReader *reader) const
RelocElement::RelocType aOutToTPEFRelocType(RelocType aOutRelocType) const
SectionElement * element(Word index) const
#define assert(condition)
virtual void addElement(SectionElement *element)
virtual Section::SectionType type() const
@ RELOC_16
2 bytes relocation
@ ST_DATA
Initialized data section.
void setType(RelocType aType)
virtual BinaryReader * parent() const
@ RT_SELF
Absolute address, relocate relative to address self.
SectionElement * destination() const
virtual void readData(BinaryStream &stream, Section *section) const
Word FileOffset
Type for storing absolute file offsets.
virtual void finalize(Section *section) const
void setSymbol(SymbolElement *aSymbol)
static void registerSectionReader(const SectionReader *sReader)
void setLocation(SectionElement *aLocation)
AOutRelocationSectionReader()
ASpaceElement * aSpaceOfElement(SectionElement *elem) const
UInt32 AddressImage
Type for storing addresses to memory image.
static AOutRelocationSectionReader proto_
Class-wide (unique) prototype instance of AOutRelocationSectionReader registered into SectionReader.
static const Header & header()
SectionOffset offset() const
bool checkIfExtern(Word word) const
SectionOffset sectionOffsetOfAddress(AddressImage address) const
virtual ~AOutRelocationSectionReader()
@ ST_RELOC
Relocation section.
void setASpace(ASpaceElement *anASpace)
virtual Word length() const
@ RELOC_8
1 byte relocation
void setDestination(SectionElement *aDestination)
SectionElement * location() const
virtual bool isCodeSection() const
virtual Word chunkToMAUIndex(const Chunk *chunk) const
virtual void writeValue(Word index, Word numOfMAUs, unsigned long value)
Word elementCount() const
@ RELOC_32
4 bytes relocation