Skip to content

Commit ac55046

Browse files
authored
Remove renaming of __wasm_call_ctors (#3811)
See emscripten-core/emscripten#13893
1 parent 0e5ade3 commit ac55046

File tree

7 files changed

+8
-19
lines changed

7 files changed

+8
-19
lines changed

src/shared-constants.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
namespace wasm {
2323

24-
extern Name WASM_CALL_CTORS;
2524
extern Name MEMORY_BASE;
2625
extern Name TABLE_BASE;
2726
extern Name STACK_POINTER;

src/tools/wasm-emscripten-finalize.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,6 @@ int main(int argc, const char* argv[]) {
298298

299299
passRunner.run();
300300

301-
if (sideModule) {
302-
BYN_TRACE("finalizing as side module\n");
303-
// The emscripten PIC ABI still expects a function named
304-
// __post_instantiate to be exported by side module.
305-
if (auto* e = wasm.getExportOrNull(WASM_CALL_CTORS)) {
306-
e->name = "__post_instantiate";
307-
}
308-
}
309-
310301
BYN_TRACE("generated metadata\n");
311302
// Substantial changes to the wasm are done, enough to create the metadata.
312303
std::string metadata = generator.generateEmscriptenMetadata();

src/wasm/wasm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const char* TypedFunctionReferencesFeature = "typed-function-references";
5050
} // namespace UserSections
5151
} // namespace BinaryConsts
5252

53-
Name WASM_CALL_CTORS("__wasm_call_ctors");
5453
Name MEMORY_BASE("__memory_base");
5554
Name TABLE_BASE("__table_base");
5655
Name STACK_POINTER("__stack_pointer");

test/lld/em_asm_shared.wat.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
(global $global$2 i32 (i32.const 4))
1919
(global $global$3 i32 (i32.const 6))
2020
(global $global$4 i32 (i32.const 90))
21-
(export "__post_instantiate" (func $__wasm_call_ctors))
21+
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
2222
(export "__original_main" (func $__original_main))
2323
(export "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJEEE6bufferE" (global $global$0))
2424
(export "_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiiEEE6bufferE" (global $global$1))
@@ -114,7 +114,7 @@
114114
"_ZN20__em_asm_sig_builderI19__em_asm_type_tupleIJiEEE6bufferE"
115115
],
116116
"exports": [
117-
"__post_instantiate",
117+
"__wasm_call_ctors",
118118
"__original_main",
119119
"main"
120120
],

test/lld/shared.wat.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
(import "env" "puts" (func $puts (param i32) (result i32)))
1414
(global $global$0 i32 (i32.const 16))
1515
(global $global$1 i32 (i32.const 20))
16-
(export "__post_instantiate" (func $__wasm_call_ctors))
16+
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
1717
(export "_Z13print_messagev" (func $print_message\28\29))
1818
(export "ptr_puts" (global $global$0))
1919
(export "ptr_local_func" (global $global$1))
@@ -65,7 +65,7 @@
6565
"_Z13print_messagev"
6666
],
6767
"exports": [
68-
"__post_instantiate",
68+
"__wasm_call_ctors",
6969
"_Z13print_messagev"
7070
],
7171
"namedGlobals": {

test/lld/shared_add_to_table.wasm.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
(import "env" "_Z16waka_func_theirsi" (func $waka_func_theirs\28int\29 (param i32) (result i32)))
1717
(global $global$0 i32 (i32.const 0))
1818
(global $global$1 i32 (i32.const 0))
19-
(export "__post_instantiate" (func $__wasm_call_ctors))
19+
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
2020
(export "__wasm_apply_relocs" (func $__wasm_apply_relocs))
2121
(export "_Z14waka_func_minei" (func $waka_func_mine\28int\29))
2222
(export "__original_main" (func $__original_main))
@@ -85,7 +85,7 @@
8585
"waka_others"
8686
],
8787
"exports": [
88-
"__post_instantiate",
88+
"__wasm_call_ctors",
8989
"__wasm_apply_relocs",
9090
"_Z14waka_func_minei",
9191
"__original_main",

test/lld/shared_longjmp.wat.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(import "env" "free" (func $fimport$7 (param i32)))
2626
(global $global$0 i32 (i32.const 0))
2727
(global $global$1 i32 (i32.const 4))
28-
(export "__post_instantiate" (func $0))
28+
(export "__wasm_call_ctors" (func $0))
2929
(export "_start" (func $2))
3030
(export "__THREW__" (global $global$0))
3131
(export "__threwValue" (global $global$1))
@@ -168,7 +168,7 @@
168168
"__threwValue"
169169
],
170170
"exports": [
171-
"__post_instantiate",
171+
"__wasm_call_ctors",
172172
"_start",
173173
"dynCall_vii"
174174
],

0 commit comments

Comments
 (0)