Skip to content

Commit b658ca6

Browse files
committed
add env name to linker, fix typo
1 parent 434f129 commit b658ca6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/wcc/wasm_linker.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,7 @@ static bool resolve_symbols(WasmLinker *linker) {
757757

758758
// Enumerate unresolved: import
759759
const Name *wasi_module_name = alloc_name(WASI_MODULE_NAME, NULL, false);
760+
const Name *wasm_module_name = alloc_name("env", NULL, false);
760761
uint32_t unresolved_func_count = 0;
761762
const Name *name;
762763
SymbolInfo *sym;
@@ -769,7 +770,8 @@ static bool resolve_symbols(WasmLinker *linker) {
769770
switch (sym->kind) {
770771
default: assert(false); // Fallthrough to suppress warning.
771772
case SIK_SYMTAB_FUNCTION:
772-
if (sym->module_name != NULL && equal_name(sym->module_name, wasi_module_name)) {
773+
if (sym->module_name != NULL && (equal_name(sym->module_name, wasi_module_name) ||
774+
equal_name(sym->module_name, wasm_module_name))) {
773775
sym->combined_index = unresolved_func_count++;
774776
break;
775777
}

src/wcc/wcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void usage(FILE *fp) {
5858
" -D <label[=value]> Define label\n"
5959
" -o <filename> Set output filename (Default: a.wasm)\n"
6060
" -c Output object file\n"
61-
" --entry-point=<name> Specify entry point (Defulat: _start)\n"
61+
" --entry-point=<name> Specify entry point (Default: _start)\n"
6262
" --stack-size=<size> Output object file (Default: 8192)\n"
6363
);
6464
}

0 commit comments

Comments
 (0)