Lines Matching defs:reloc
108 uint32_t ObjFile::calcNewIndex(const WasmRelocation &reloc) const {
109 if (reloc.Type == R_WASM_TYPE_INDEX_LEB) {
110 assert(typeIsUsed[reloc.Index]);
111 return typeMap[reloc.Index];
113 const Symbol *sym = symbols[reloc.Index];
121 int64_t ObjFile::calcNewAddend(const WasmRelocation &reloc) const {
122 switch (reloc.Type) {
136 return reloc.Addend;
138 return getSectionSymbol(reloc.Index)->section->getOffset(reloc.Addend);
145 uint64_t ObjFile::calcNewValue(const WasmRelocation &reloc, uint64_t tombstone,
148 if (reloc.Type != R_WASM_TYPE_INDEX_LEB) {
149 sym = symbols[reloc.Index];
154 // code. In other sections we return reloc.Addend.
157 return tombstone ? tombstone : reloc.Addend;
160 switch (reloc.Type) {
167 if (!getFunctionSymbol(reloc.Index)->hasTableIndex())
169 uint32_t index = getFunctionSymbol(reloc.Index)->getTableIndex();
170 if (reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB ||
171 reloc.Type == R_WASM_TABLE_INDEX_REL_SLEB64)
189 uint64_t value = D->getVA() + reloc.Addend;
190 if (reloc.Type == R_WASM_MEMORY_ADDR_LOCREL_I32) {
193 reloc.Offset - segment->getInputSectionOffset();
199 return typeMap[reloc.Index];
202 return getFunctionSymbol(reloc.Index)->getFunctionIndex();
209 return getTagSymbol(reloc.Index)->getTagIndex();
213 return tombstone ? tombstone : reloc.Addend;
217 reloc.Addend);
220 return getSectionSymbol(reloc.Index)->section->getOffset(reloc.Addend);
222 return getTableSymbol(reloc.Index)->getTableNumber();
556 for (const WasmRelocation &reloc : section.Relocations)
557 if (reloc.Type == R_WASM_FUNCTION_INDEX_LEB)
558 isCalledDirectly[reloc.Index] = true;