Lines Matching refs:ELFT
44 template <class ELFT>
45 static ArrayRef<uint8_t> getSectionContents(ObjFile<ELFT> &file, in getSectionContents()
46 const typename ELFT::Shdr &hdr) { in getSectionContents()
89 template <class ELFT>
90 InputSectionBase::InputSectionBase(ObjFile<ELFT> &file, in InputSectionBase()
91 const typename ELFT::Shdr &hdr, in InputSectionBase()
110 template <class ELFT>
113 auto *hdr = reinterpret_cast<const typename ELFT::Chdr *>(sec.content_); in decompressAux()
115 .slice(sizeof(typename ELFT::Chdr)); in decompressAux()
136 template <class ELFT>
137 RelsOrRelas<ELFT> InputSectionBase::relsOrRelas(bool supportsCrel) const { in relsOrRelas()
140 RelsOrRelas<ELFT> ret; in relsOrRelas()
141 auto *f = cast<ObjFile<ELFT>>(file); in relsOrRelas()
142 typename ELFT::Shdr shdr = f->template getELFShdrs<ELFT>()[relSecIdx]; in relsOrRelas()
146 ret.crels = Relocs<typename ELFT::Crel>( in relsOrRelas()
160 RelocsCrel<ELFT::Is64Bits> entries(sec->content_); in relsOrRelas()
161 sec->size = entries.size() * sizeof(typename ELFT::Rela); in relsOrRelas()
162 auto *relas = makeThreadLocalN<typename ELFT::Rela>(entries.size()); in relsOrRelas()
171 reinterpret_cast<const typename ELFT::Rela *>(relSec->content_), in relsOrRelas()
172 relSec->size / sizeof(typename ELFT::Rela))}; in relsOrRelas()
179 ret.rels = {ArrayRef(reinterpret_cast<const typename ELFT::Rel *>(content), in relsOrRelas()
180 size / sizeof(typename ELFT::Rel))}; in relsOrRelas()
184 ArrayRef(reinterpret_cast<const typename ELFT::Rela *>(content), in relsOrRelas()
185 size / sizeof(typename ELFT::Rela))}; in relsOrRelas()
244 template <typename ELFT> void InputSectionBase::parseCompressedHeader() { in parseCompressedHeader()
248 if (content().size() < sizeof(typename ELFT::Chdr)) { in parseCompressedHeader()
253 auto *hdr = reinterpret_cast<const typename ELFT::Chdr *>(content().data()); in parseCompressedHeader()
365 template <class ELFT>
366 InputSection::InputSection(ObjFile<ELFT> &f, const typename ELFT::Shdr &header, in InputSection()
371 template <class ELFT> void InputSection::copyShtGroup(uint8_t *buf) { in copyShtGroup()
373 using u32 = typename ELFT::Word; in copyShtGroup()
399 template <class ELFT, class RelTy>
406 copyRelocations<ELFT, RelTy>(buf, llvm::make_range(sec->relocations.begin(), in copyRelocations()
412 const ObjFile<ELFT> &file; in copyRelocations()
416 getAddend<ELFT>(rel), &file.getRelocTargetSym(rel)}; in copyRelocations()
423 auto mapRel = MapRel{*getFile<ELFT>()}; in copyRelocations()
427 copyRelocations<ELFT, RelTy>(buf, rels); in copyRelocations()
434 template <class ELFT, class RelTy, class RelIt>
443 const ObjFile<ELFT> *file = getFile<ELFT>(); in copyRelocations()
446 auto *p = reinterpret_cast<typename ELFT::Rela *>(buf); in copyRelocations()
477 Elf_Shdr_Impl<ELFT> sec = file->template getELFShdrs<ELFT>()[secIdx]; in copyRelocations()
506 addend += sec->getFile<ELFT>()->mipsGp0; in copyRelocations()
948 template <class ELFT, class RelTy>
950 const unsigned bits = sizeof(typename ELFT::uint) * 8; in relocateNonAlloc()
976 int64_t addend = getAddend<ELFT>(rel); in relocateNonAlloc()
995 (f->getRelocTargetSym(*it).getVA(0) + getAddend<ELFT>(*it)); in relocateNonAlloc()
1098 template <class ELFT>
1100 if ((flags & SHF_EXECINSTR) && LLVM_UNLIKELY(getFile<ELFT>()->splitStack)) in relocate()
1101 adjustSplitStackFunctionPrologues<ELFT>(buf, bufEnd); in relocate()
1111 invokeOnRelocs(*sec, sec->relocateNonAlloc<ELFT>, buf); in relocate()
1164 template <class ELFT>
1191 if (!isec || !isec->getFile<ELFT>() || isec->getFile<ELFT>()->splitStack) in adjustSplitStackFunctionPrologues()
1202 if (!getFile<ELFT>()->someNoSplitStack) in adjustSplitStackFunctionPrologues()
1213 template <class ELFT> void InputSection::writeTo(uint8_t *buf) { in writeTo()
1219 copyRelocations<ELFT, typename ELFT::Rela>(buf); in writeTo()
1223 copyRelocations<ELFT, typename ELFT::Rel>(buf); in writeTo()
1229 copyShtGroup<ELFT>(buf); in writeTo()
1236 auto *hdr = reinterpret_cast<const typename ELFT::Chdr *>(content_); in writeTo()
1238 .slice(sizeof(typename ELFT::Chdr)); in writeTo()
1246 relocate<ELFT>(buf, bufEnd); in writeTo()
1253 relocate<ELFT>(buf, buf + content().size()); in writeTo()
1273 template <class ELFT>
1274 EhInputSection::EhInputSection(ObjFile<ELFT> &f, in EhInputSection()
1275 const typename ELFT::Shdr &header, in EhInputSection()
1285 template <class ELFT> void EhInputSection::split() { in split()
1286 const RelsOrRelas<ELFT> rels = relsOrRelas<ELFT>(/*supportsCrel=*/false); in split()
1290 SmallVector<typename ELFT::Rel, 0> storage; in split()
1291 split<ELFT>(sortRels(rels.rels, storage)); in split()
1293 SmallVector<typename ELFT::Rela, 0> storage; in split()
1294 split<ELFT>(sortRels(rels.relas, storage)); in split()
1298 template <class ELFT, class RelTy>
1308 uint64_t size = endian::read32<ELFT::Endianness>(d.data()); in split()
1311 uint32_t id = endian::read32<ELFT::Endianness>(d.data() + 4); in split()
1398 template <class ELFT>
1399 MergeInputSection::MergeInputSection(ObjFile<ELFT> &f, in MergeInputSection()
1400 const typename ELFT::Shdr &header, in MergeInputSection()