Lines Matching refs:reloc
101 uint32_t ObjFile::calcNewIndex(const WasmRelocation &reloc) const { in calcNewIndex()
102 if (reloc.Type == R_WASM_TYPE_INDEX_LEB) { in calcNewIndex()
103 assert(typeIsUsed[reloc.Index]); in calcNewIndex()
104 return typeMap[reloc.Index]; in calcNewIndex()
106 const Symbol *sym = symbols[reloc.Index]; in calcNewIndex()
114 int64_t ObjFile::calcNewAddend(const WasmRelocation &reloc) const { in calcNewAddend()
115 switch (reloc.Type) { in calcNewAddend()
129 return reloc.Addend; in calcNewAddend()
131 return getSectionSymbol(reloc.Index)->section->getOffset(reloc.Addend); in calcNewAddend()
138 uint64_t ObjFile::calcNewValue(const WasmRelocation &reloc, uint64_t tombstone, in calcNewValue() argument
141 if (reloc.Type != R_WASM_TYPE_INDEX_LEB) { in calcNewValue()
142 sym = symbols[reloc.Index]; in calcNewValue()
150 return tombstone ? tombstone : reloc.Addend; in calcNewValue()
153 switch (reloc.Type) { in calcNewValue()
160 if (!getFunctionSymbol(reloc.Index)->hasTableIndex()) in calcNewValue()
162 uint32_t index = getFunctionSymbol(reloc.Index)->getTableIndex(); in calcNewValue()
163 if (reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB || in calcNewValue()
164 reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB64) in calcNewValue()
182 uint64_t value = D->getVA() + reloc.Addend; in calcNewValue()
183 if (reloc.Type == R_WASM_MEMORY_ADDR_LOCREL_I32) { in calcNewValue()
186 reloc.Offset - segment->getInputSectionOffset(); in calcNewValue()
192 return typeMap[reloc.Index]; in calcNewValue()
194 return getFunctionSymbol(reloc.Index)->getFunctionIndex(); in calcNewValue()
201 return getTagSymbol(reloc.Index)->getTagIndex(); in calcNewValue()
205 return tombstone ? tombstone : reloc.Addend; in calcNewValue()
209 reloc.Addend); in calcNewValue()
212 return getSectionSymbol(reloc.Index)->section->getOffset(reloc.Addend); in calcNewValue()
214 return getTableSymbol(reloc.Index)->getTableNumber(); in calcNewValue()
467 for (const WasmRelocation &reloc : section.Relocations) in parse() local
468 if (reloc.Type == R_WASM_FUNCTION_INDEX_LEB) in parse()
469 isCalledDirectly[reloc.Index] = true; in parse()