Lines Matching defs:rel

112   for (const WasmRelocation &rel : relocations) {
113 uint8_t *loc = buf + rel.Offset - inputSectionOffset;
114 LLVM_DEBUG(dbgs() << "apply reloc: type=" << relocTypeToString(rel.Type));
115 if (rel.Type != R_WASM_TYPE_INDEX_LEB)
116 LLVM_DEBUG(dbgs() << " sym=" << file->getSymbols()[rel.Index]->getName());
117 LLVM_DEBUG(dbgs() << " addend=" << rel.Addend << " index=" << rel.Index
118 << " offset=" << rel.Offset << "\n");
122 uint64_t value = file->calcNewValue(rel, tombstone, this);
124 switch (rel.Type) {
181 for (const WasmRelocation &rel : relocations) {
182 writeUleb128(os, rel.Type, "reloc type");
183 writeUleb128(os, rel.Offset + off, "reloc offset");
184 writeUleb128(os, file->calcNewIndex(rel), "reloc index");
186 if (relocTypeHasAddend(rel.Type))
187 writeSleb128(os, file->calcNewAddend(rel), "reloc addend");
215 static unsigned writeCompressedReloc(uint8_t *buf, const WasmRelocation &rel,
217 switch (rel.Type) {
236 static unsigned getRelocWidthPadded(const WasmRelocation &rel) {
237 switch (rel.Type) {
256 static unsigned getRelocWidth(const WasmRelocation &rel, uint64_t value) {
258 return writeCompressedReloc(buf, rel, value);
288 for (const WasmRelocation &rel : relocations) {
289 LLVM_DEBUG(dbgs() << " region: " << (rel.Offset - lastRelocEnd) << "\n");
290 compressedFuncSize += rel.Offset - lastRelocEnd;
292 getRelocWidth(rel, file->calcNewValue(rel, tombstone, this));
293 lastRelocEnd = rel.Offset + getRelocWidthPadded(rel);
325 for (const WasmRelocation &rel : relocations) {
326 unsigned chunkSize = (secStart + rel.Offset) - lastRelocEnd;
330 buf += writeCompressedReloc(buf, rel,
331 file->calcNewValue(rel, tombstone, this));
332 lastRelocEnd = secStart + rel.Offset + getRelocWidthPadded(rel);
378 for (const WasmRelocation &rel : relocations) {
379 uint64_t offset = getVA(rel.Offset) - getInputSectionOffset();
381 Symbol *sym = file->getSymbol(rel);
388 LLVM_DEBUG(dbgs() << "gen reloc: type=" << relocTypeToString(rel.Type)
389 << " addend=" << rel.Addend << " index=" << rel.Index
407 bool is64 = relocIs64(rel.Type);
418 if (rel.Addend) {
420 writeSleb128(os, rel.Addend, "addend");
426 if (rel.Type == R_WASM_TABLE_INDEX_I32 ||
427 rel.Type == R_WASM_TABLE_INDEX_I64)
434 writeSleb128(os, file->calcNewValue(rel, tombstone, this), "offset");