Merge pull request #5 from AntelopeIO/unhide_cust_entry

Fix the customized sync call entry function not being exported
This commit is contained in:
Lin Huang
2025-07-28 10:43:41 -04:00
committed by GitHub
2 changed files with 9 additions and 3 deletions
+1
View File
@@ -779,6 +779,7 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
// Is sync_call entry symbol found
if (toString(*sym) == "sync_call") { // OK to hard code sync call entry here. Spring validate the entry function name to be "sync_call"
symtab->syncCallEntryIsUndefined = false;
sym->setHidden(false); // Unhide it such that it can be put in the export section
}
if (!symtab->entryIsUndefined && !symtab->syncCallEntryIsUndefined) {
+8 -3
View File
@@ -118,10 +118,15 @@ void lld::wasm::markLive() {
}
}
if (has_sync_calls) {
// If there are functions tagged as sync calls or customized
// sync call entry function is provided, mark relevant functions live
if (has_sync_calls || !symtab->syncCallEntryIsUndefined) {
enqueue(WasmSym::syncCallFunc);
enqueue(symtab->find("__eos_get_sync_call_data_"));
enqueue(symtab->find("__eos_get_sync_call_data_header_"));
if (has_sync_calls) { // only required by generated sync call entry function
enqueue(symtab->find("__eos_get_sync_call_data_"));
enqueue(symtab->find("__eos_get_sync_call_data_header_"));
}
}
for (const auto& import : wasmObj->imports()) {