ELFSection::SHF_EXECINSTR | ELFSection::SHF_ALLOC);
}
- /// Return the relocation section of section 'S'. 'RelA' is true
- /// if the relocation section contains entries with addends.
- ELFSection &getRelocSection(std::string SName, bool RelA, unsigned Align) {
- std::string RelSName(".rel");
- unsigned SHdrTy = RelA ? ELFSection::SHT_RELA : ELFSection::SHT_REL;
-
- if (RelA) RelSName.append("a");
- RelSName.append(SName);
-
- return getSection(RelSName, SHdrTy, 0, Align);
- }
-
ELFSection &getNonExecStackSection() {
return getSection(".note.GNU-stack", ELFSection::SHT_PROGBITS, 0, 1);
}
ELFSection &getJumpTableSection();
ELFSection &getConstantPoolSection(MachineConstantPoolEntry &CPE);
+ ELFSection &getRelocSection(ELFSection &S);
// Helpers for obtaining ELF specific info.
unsigned getGlobalELFBinding(const GlobalValue *GV);
unsigned getGlobalELFVisibility(const GlobalValue *GV);
unsigned getElfSectionFlags(unsigned Flags);
+ // setGlobalSymLookup - Set global value 'GV' with 'Index' in the lookup map
+ void setGlobalSymLookup(const GlobalValue *GV, unsigned Index) {
+ GblSymLookup[GV] = Index;
+ }
+
// As we complete the ELF file, we need to update fields in the ELF header
// (e.g. the location of the section table). These members keep track of
// the offset in ELFHeader of these various pieces to update and other
void EmitSymbolTable();
void EmitStringTable();
void OutputSectionsAndSectionTable();
+ void RelocateField(BinaryObject &BO, uint32_t Offset, int64_t Value,
+ unsigned Size);
unsigned SortSymbols();
};
}