Skip to content

Commit 074844e

Browse files
committed
When renaming functions ensure the corresponding GOT.func entry is also renamed
Fixes #2180
1 parent 8d19d00 commit 074844e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wasm/wasm-emscripten.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,13 @@ struct FixInvokeFunctionNamesWalker
10411041
wasm.removeFunction(importName);
10421042
}
10431043
ModuleUtils::renameFunctions(wasm, importRenames);
1044+
ImportInfo imports(wasm);
1045+
for (auto& pair : importRenames) {
1046+
// Update any associated GOT.func import.
1047+
if (auto g = imports.getImportedGlobal("GOT.func", pair.first)) {
1048+
g->base = pair.second;
1049+
}
1050+
}
10441051
}
10451052
};
10461053

0 commit comments

Comments
 (0)