}
template <class ELFT> void ELFWriter<ELFT>::writePhdr(const Segment &Seg) {
- using Elf_Phdr = typename ELFT::Phdr;
-
uint8_t *B = Buf.getBufferStart();
B += Obj.ProgramHdrSegment.Offset + Seg.Index * sizeof(Elf_Phdr);
Elf_Phdr &Phdr = *reinterpret_cast<Elf_Phdr *>(B);
template <class ELFT> void ELFWriter<ELFT>::writeShdr(const SectionBase &Sec) {
uint8_t *B = Buf.getBufferStart();
B += Sec.HeaderOffset;
- typename ELFT::Shdr &Shdr = *reinterpret_cast<typename ELFT::Shdr *>(B);
+ Elf_Shdr &Shdr = *reinterpret_cast<Elf_Shdr *>(B);
Shdr.sh_name = Sec.NameIndex;
Shdr.sh_type = Sec.Type;
Shdr.sh_flags = Sec.Flags;
template <class ELFT>
void ELFSectionWriter<ELFT>::visit(const SectionIndexSection &Sec) {
uint8_t *Buf = Out.getBufferStart() + Sec.Offset;
- auto *IndexesBuffer = reinterpret_cast<typename ELFT::Word *>(Buf);
+ auto *IndexesBuffer = reinterpret_cast<Elf_Word *>(Buf);
std::copy(std::begin(Sec.Indexes), std::end(Sec.Indexes), IndexesBuffer);
}
void ELFSectionWriter<ELFT>::visit(const SymbolTableSection &Sec) {
uint8_t *Buf = Out.getBufferStart();
Buf += Sec.Offset;
- typename ELFT::Sym *Sym = reinterpret_cast<typename ELFT::Sym *>(Buf);
+ Elf_Sym *Sym = reinterpret_cast<Elf_Sym *>(Buf);
// Loop though symbols setting each entry of the symbol table.
for (auto &Symbol : Sec.Symbols) {
Sym->st_name = Symbol->NameIndex;
// If we need to write the section header table out then we need to align the
// Offset so that SHOffset is valid.
if (WriteSectionHeaders)
- Offset = alignTo(Offset, sizeof(typename ELFT::Addr));
+ Offset = alignTo(Offset, sizeof(Elf_Addr));
Obj.SHOffset = Offset;
}