Lines Matching refs:rel
112 for (const WasmRelocation &rel : relocations) { in relocate() local
113 uint8_t *loc = buf + rel.Offset - inputSectionOffset; in relocate()
114 LLVM_DEBUG(dbgs() << "apply reloc: type=" << relocTypeToString(rel.Type)); in relocate()
115 if (rel.Type != R_WASM_TYPE_INDEX_LEB) in relocate()
116 LLVM_DEBUG(dbgs() << " sym=" << file->getSymbols()[rel.Index]->getName()); in relocate()
117 LLVM_DEBUG(dbgs() << " addend=" << rel.Addend << " index=" << rel.Index in relocate()
118 << " offset=" << rel.Offset << "\n"); in relocate()
122 uint64_t value = file->calcNewValue(rel, tombstone, this); in relocate()
124 switch (rel.Type) { in relocate()
180 for (const WasmRelocation &rel : relocations) { in writeRelocations() local
181 writeUleb128(os, rel.Type, "reloc type"); in writeRelocations()
182 writeUleb128(os, rel.Offset + off, "reloc offset"); in writeRelocations()
183 writeUleb128(os, file->calcNewIndex(rel), "reloc index"); in writeRelocations()
185 if (relocTypeHasAddend(rel.Type)) in writeRelocations()
186 writeSleb128(os, file->calcNewAddend(rel), "reloc addend"); in writeRelocations()
214 static unsigned writeCompressedReloc(uint8_t *buf, const WasmRelocation &rel, in writeCompressedReloc() argument
216 switch (rel.Type) { in writeCompressedReloc()
235 static unsigned getRelocWidthPadded(const WasmRelocation &rel) { in getRelocWidthPadded() argument
236 switch (rel.Type) { in getRelocWidthPadded()
255 static unsigned getRelocWidth(const WasmRelocation &rel, uint64_t value) { in getRelocWidth() argument
257 return writeCompressedReloc(buf, rel, value); in getRelocWidth()
287 for (const WasmRelocation &rel : relocations) { in calculateSize() local
288 LLVM_DEBUG(dbgs() << " region: " << (rel.Offset - lastRelocEnd) << "\n"); in calculateSize()
289 compressedFuncSize += rel.Offset - lastRelocEnd; in calculateSize()
291 getRelocWidth(rel, file->calcNewValue(rel, tombstone, this)); in calculateSize()
292 lastRelocEnd = rel.Offset + getRelocWidthPadded(rel); in calculateSize()
324 for (const WasmRelocation &rel : relocations) { in writeCompressed() local
325 unsigned chunkSize = (secStart + rel.Offset) - lastRelocEnd; in writeCompressed()
329 buf += writeCompressedReloc(buf, rel, in writeCompressed()
330 file->calcNewValue(rel, tombstone, this)); in writeCompressed()
331 lastRelocEnd = secStart + rel.Offset + getRelocWidthPadded(rel); in writeCompressed()
376 for (const WasmRelocation &rel : relocations) { in generateRelocationCode() local
377 uint64_t offset = getVA(rel.Offset) - getInputSectionOffset(); in generateRelocationCode()
379 Symbol *sym = file->getSymbol(rel); in generateRelocationCode()
383 LLVM_DEBUG(dbgs() << "gen reloc: type=" << relocTypeToString(rel.Type) in generateRelocationCode()
384 << " addend=" << rel.Addend << " index=" << rel.Index in generateRelocationCode()
399 bool is64 = relocIs64(rel.Type); in generateRelocationCode()
410 if (rel.Addend) { in generateRelocationCode()
412 writeSleb128(os, rel.Addend, "addend"); in generateRelocationCode()
418 if (rel.Type == R_WASM_TABLE_INDEX_I32 || in generateRelocationCode()
419 rel.Type == R_WASM_TABLE_INDEX_I64) in generateRelocationCode()
424 writeSleb128(os, file->calcNewValue(rel, tombstone, this), "offset"); in generateRelocationCode()