Lines Matching refs:ELFT

98 template <class ELFT>
99 MipsAbiFlagsSection<ELFT>::MipsAbiFlagsSection(Elf_Mips_ABIFlags flags) in MipsAbiFlagsSection()
105 template <class ELFT> void MipsAbiFlagsSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
109 template <class ELFT>
110 std::unique_ptr<MipsAbiFlagsSection<ELFT>> MipsAbiFlagsSection<ELFT>::create() { in create()
153 return std::make_unique<MipsAbiFlagsSection<ELFT>>(flags); in create()
158 template <class ELFT>
159 MipsOptionsSection<ELFT>::MipsOptionsSection(Elf_Mips_RegInfo reginfo) in MipsOptionsSection()
165 template <class ELFT> void MipsOptionsSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
175 template <class ELFT>
176 std::unique_ptr<MipsOptionsSection<ELFT>> MipsOptionsSection<ELFT>::create() { in create()
178 if (!ELFT::Is64Bits) in create()
205 sec->getFile<ELFT>()->mipsGp0 = opt->getRegInfo().ri_gp_value; in create()
215 return std::make_unique<MipsOptionsSection<ELFT>>(reginfo); in create()
219 template <class ELFT>
220 MipsReginfoSection<ELFT>::MipsReginfoSection(Elf_Mips_RegInfo reginfo) in MipsReginfoSection()
226 template <class ELFT> void MipsReginfoSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
232 template <class ELFT>
233 std::unique_ptr<MipsReginfoSection<ELFT>> MipsReginfoSection<ELFT>::create() { in create()
235 if (ELFT::Is64Bits) in create()
257 sec->getFile<ELFT>()->mipsGp0 = r->ri_gp_value; in create()
260 return std::make_unique<MipsReginfoSection<ELFT>>(reginfo); in create()
387 template <class ELFT, class RelTy>
408 template <class ELFT, class RelTy>
436 template <class ELFT, class RelTy>
440 offsetToCie[cie.inputOff] = addCie<ELFT>(cie, rels); in addRecords()
442 uint32_t id = endian::read32<ELFT::Endianness>(fde.data().data() + 4); in addRecords()
447 if (!isFdeLive<ELFT>(fde, rels)) in addRecords()
454 template <class ELFT>
458 const RelsOrRelas<ELFT> rels = in addSectionAux()
459 sec->template relsOrRelas<ELFT>(/*supportsCrel=*/false); in addSectionAux()
461 addRecords<ELFT>(sec, rels.rels); in addSectionAux()
463 addRecords<ELFT>(sec, rels.relas); in addSectionAux()
468 template <class ELFT, class RelTy>
476 uint32_t id = endian::read32<ELFT::Endianness>(fde.data().data() + 4); in iterateFDEWithLSDAAux()
481 if (Defined *d = isFdeLive<ELFT>(fde, rels)) in iterateFDEWithLSDAAux()
487 template <class ELFT>
493 const RelsOrRelas<ELFT> rels = in iterateFDEWithLSDA()
494 sec->template relsOrRelas<ELFT>(/*supportsCrel=*/false); in iterateFDEWithLSDA()
496 iterateFDEWithLSDAAux<ELFT>(*sec, rels.rels, ciesWithLSDA, fn); in iterateFDEWithLSDA()
498 iterateFDEWithLSDAAux<ELFT>(*sec, rels.relas, ciesWithLSDA, fn); in iterateFDEWithLSDA()
1279 template <class ELFT>
1280 DynamicSection<ELFT>::DynamicSection() in DynamicSection()
1283 this->entsize = ELFT::Is64Bits ? 16 : 8; in DynamicSection()
1314 template <class ELFT>
1316 DynamicSection<ELFT>::computeContents() { in computeContents()
1573 template <class ELFT> void DynamicSection<ELFT>::finalizeContents() { in finalizeContents()
1579 template <class ELFT> void DynamicSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
1720 template <class ELFT>
1721 RelocationSection<ELFT>::RelocationSection(StringRef name, bool combreloc, in RelocationSection()
1730 template <class ELFT> void RelocationSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
1761 template <class ELFT>
1762 AndroidPackedRelocationSection<ELFT>::AndroidPackedRelocationSection( in AndroidPackedRelocationSection()
1772 template <class ELFT>
1773 bool AndroidPackedRelocationSection<ELFT>::updateAllocSize() { in updateAllocSize()
2015 template <class ELFT>
2016 RelrSection<ELFT>::RelrSection(unsigned concurrency, bool isAArch64Auth) in RelrSection()
2021 template <class ELFT> bool RelrSection<ELFT>::updateAllocSize() { in updateAllocSize()
2057 const size_t wordsize = sizeof(typename ELFT::uint); in updateAllocSize()
2219 template <class ELFT>
2220 SymbolTableSection<ELFT>::SymbolTableSection(StringTableSection &strTabSec) in SymbolTableSection()
2243 template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
2313 if (isMipsPIC<ELFT>(d)) in writeTo()
3162 template <class ELFT> DebugNamesSection<ELFT>::DebugNamesSection() { in DebugNamesSection()
3164 auto *file = cast<ObjFile<ELFT>>(f); in DebugNamesSection()
3165 DWARFContext dwarf(std::make_unique<LLDDwarfObj<ELFT>>(file)); in DebugNamesSection()
3166 auto &dobj = static_cast<const LLDDwarfObj<ELFT> &>(dwarf.getDWARFObj()); in DebugNamesSection()
3169 ELFT::Endianness == endianness::little, in DebugNamesSection()
3170 ELFT::Is64Bits ? 8 : 4); in DebugNamesSection()
3173 ELFT::Endianness == endianness::little, in DebugNamesSection()
3174 ELFT::Is64Bits ? 8 : 4); in DebugNamesSection()
3199 offset = endian::readNext<uint32_t, ELFT::Endianness, unaligned>(p); in DebugNamesSection()
3205 template <class ELFT>
3207 void DebugNamesSection<ELFT>::getNameRelocs( in getNameRelocs()
3212 relocs[rel.r_offset] = sym.getVA(getAddend<ELFT>(rel)); in getNameRelocs()
3216 template <class ELFT> void DebugNamesSection<ELFT>::finalizeContents() { in finalizeContents()
3236 template <class ELFT> void DebugNamesSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
3239 endian::writeNext<uint32_t, ELFT::Endianness>(buf, hdr.UnitLength); in writeTo()
3240 endian::writeNext<uint16_t, ELFT::Endianness>(buf, hdr.Version); in writeTo()
3242 endian::writeNext<uint32_t, ELFT::Endianness>(buf, hdr.CompUnitCount); in writeTo()
3243 endian::writeNext<uint32_t, ELFT::Endianness>(buf, hdr.LocalTypeUnitCount); in writeTo()
3244 endian::writeNext<uint32_t, ELFT::Endianness>(buf, hdr.ForeignTypeUnitCount); in writeTo()
3245 endian::writeNext<uint32_t, ELFT::Endianness>(buf, hdr.BucketCount); in writeTo()
3246 endian::writeNext<uint32_t, ELFT::Endianness>(buf, hdr.NameCount); in writeTo()
3247 endian::writeNext<uint32_t, ELFT::Endianness>(buf, hdr.AbbrevTableSize); in writeTo()
3248 endian::writeNext<uint32_t, ELFT::Endianness>(buf, in writeTo()
3256 endian::writeNext<uint32_t, ELFT::Endianness>(buf, cuOffset); in writeTo()
3271 endian::write32<ELFT::Endianness>(buf, bucketIdx); in writeTo()
3278 endian::writeNext<uint32_t, ELFT::Endianness>(buf, e->hashValue); in writeTo()
3286 endian::writeNext<uint32_t, ELFT::Endianness>(buf, ne->stringOffset); in writeTo()
3291 endian::writeNext<uint32_t, ELFT::Endianness>(buf, ne->entryOffset); in writeTo()
3309 endian::writeNext<uint16_t, ELFT::Endianness>(buf, value.attrValue); in writeTo()
3312 endian::writeNext<uint32_t, ELFT::Endianness>(buf, value.attrValue); in writeTo()
3374 template <class ELFT>
3376 readPubNamesAndTypes(const LLDDwarfObj<ELFT> &obj, in readPubNamesAndTypes()
3383 DWARFDataExtractor data(obj, *pub, ELFT::Endianness == endianness::little, in readPubNamesAndTypes()
3384 ELFT::Is64Bits ? 8 : 4); in readPubNamesAndTypes()
3487 template <class ELFT>
3522 ObjFile<ELFT> *file = cast<ObjFile<ELFT>>(files[i]); in create()
3523 DWARFContext dwarf(std::make_unique<LLDDwarfObj<ELFT>>(file)); in create()
3524 auto &dobj = static_cast<const LLDDwarfObj<ELFT> &>(dwarf.getDWARFObj()); in create()
3531 nameAttrs[i] = readPubNamesAndTypes<ELFT>(dobj, chunks[i].compilationUnits); in create()
3775 template <class ELFT>
3776 VersionNeedSection<ELFT>::VersionNeedSection() in VersionNeedSection()
3780 template <class ELFT> void VersionNeedSection<ELFT>::finalizeContents() { in finalizeContents()
3793 reinterpret_cast<const typename ELFT::Verdef *>(f->verdefs[i]); in finalizeContents()
3813 template <class ELFT> void VersionNeedSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
3843 template <class ELFT> size_t VersionNeedSection<ELFT>::getSize() const { in getSize()
3848 template <class ELFT> bool VersionNeedSection<ELFT>::isNeeded() const { in isNeeded()
3945 template <class ELFT> void elf::splitSections() { in splitSections()
3956 eh->split<ELFT>(); in splitSections()
4362 template <typename ELFT> void elf::writeEhdr(uint8_t *buf, Partition &part) { in writeEhdr()
4365 auto *eHdr = reinterpret_cast<typename ELFT::Ehdr *>(buf); in writeEhdr()
4366 eHdr->e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32; in writeEhdr()
4368 ELFT::Endianness == endianness::little ? ELFDATA2LSB : ELFDATA2MSB; in writeEhdr()
4375 eHdr->e_ehsize = sizeof(typename ELFT::Ehdr); in writeEhdr()
4377 eHdr->e_shentsize = sizeof(typename ELFT::Shdr); in writeEhdr()
4380 eHdr->e_phoff = sizeof(typename ELFT::Ehdr); in writeEhdr()
4381 eHdr->e_phentsize = sizeof(typename ELFT::Phdr); in writeEhdr()
4385 template <typename ELFT> void elf::writePhdrs(uint8_t *buf, Partition &part) { in writePhdrs()
4387 auto *hBuf = reinterpret_cast<typename ELFT::Phdr *>(buf); in writePhdrs()
4401 template <typename ELFT>
4402 PartitionElfHeaderSection<ELFT>::PartitionElfHeaderSection() in PartitionElfHeaderSection()
4405 template <typename ELFT>
4406 size_t PartitionElfHeaderSection<ELFT>::getSize() const { in getSize()
4407 return sizeof(typename ELFT::Ehdr); in getSize()
4410 template <typename ELFT>
4411 void PartitionElfHeaderSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
4412 writeEhdr<ELFT>(buf, getPartition()); in writeTo()
4415 auto *eHdr = reinterpret_cast<typename ELFT::Ehdr *>(buf); in writeTo()
4419 template <typename ELFT>
4420 PartitionProgramHeadersSection<ELFT>::PartitionProgramHeadersSection() in PartitionProgramHeadersSection()
4423 template <typename ELFT>
4424 size_t PartitionProgramHeadersSection<ELFT>::getSize() const { in getSize()
4425 return sizeof(typename ELFT::Phdr) * getPartition().phdrs.size(); in getSize()
4428 template <typename ELFT>
4429 void PartitionProgramHeadersSection<ELFT>::writeTo(uint8_t *buf) { in writeTo()
4430 writePhdrs<ELFT>(buf, getPartition()); in writeTo()
4649 template <class ELFT> void elf::createSyntheticSections() { in createSyntheticSections()
4677 in.symTab = std::make_unique<SymbolTableSection<ELFT>>(*in.strTab); in createSyntheticSections()
4698 if ((in.mipsAbiFlags = MipsAbiFlagsSection<ELFT>::create())) in createSyntheticSections()
4700 if ((in.mipsOptions = MipsOptionsSection<ELFT>::create())) in createSyntheticSections()
4702 if ((in.mipsReginfo = MipsReginfoSection<ELFT>::create())) in createSyntheticSections()
4716 part.elfHeader = std::make_unique<PartitionElfHeaderSection<ELFT>>(); in createSyntheticSections()
4721 std::make_unique<PartitionProgramHeadersSection<ELFT>>(); in createSyntheticSections()
4734 std::make_unique<SymbolTableSection<ELFT>>(*part.dynStrTab); in createSyntheticSections()
4738 part.dynamic = std::make_unique<DynamicSection<ELFT>>(); in createSyntheticSections()
4751 part.relaDyn = std::make_unique<AndroidPackedRelocationSection<ELFT>>( in createSyntheticSections()
4754 part.relaDyn = std::make_unique<RelocationSection<ELFT>>( in createSyntheticSections()
4768 part.verNeed = std::make_unique<VersionNeedSection<ELFT>>(); in createSyntheticSections()
4787 part.relrDyn = std::make_unique<RelrSection<ELFT>>(threadCount); in createSyntheticSections()
4789 part.relrAuthDyn = std::make_unique<RelrSection<ELFT>>( in createSyntheticSections()
4878 in.relaPlt = std::make_unique<RelocationSection<ELFT>>( in createSyntheticSections()
4901 in.debugNames = std::make_unique<DebugNamesSection<ELFT>>(); in createSyntheticSections()
4906 in.gdbIndex = GdbIndexSection::create<ELFT>(); in createSyntheticSections()