diff --git a/src/llvm-multiversioning.cpp b/src/llvm-multiversioning.cpp index 81fbac23dbc52b..6ee845af4179e6 100644 --- a/src/llvm-multiversioning.cpp +++ b/src/llvm-multiversioning.cpp @@ -1037,7 +1037,7 @@ void CloneCtx::emit_metadata() idxs.push_back(baseidx); for (uint32_t j = 0; j < nfvars; j++) { auto base_f = grp->base_func(fvars[j]); - if (shared_relocs.count(j)) { + if (shared_relocs.count(j) || tgt->relocs.count(j)) { count++; idxs.push_back(jl_sysimg_tag_mask | j); auto f = map_get(*tgt->vmap, base_f, base_f); @@ -1045,7 +1045,7 @@ void CloneCtx::emit_metadata() } else if (auto f = map_get(*tgt->vmap, base_f)) { count++; - idxs.push_back(tgt->relocs.count(j) ? (jl_sysimg_tag_mask | j) : j); + idxs.push_back(j); offsets.push_back(get_ptrdiff32(cast(f), fbase)); } }