When compiling a C program with -Wl,--export-all, more debug info is generated.
For example, take this program:
#include <stdio.h>
#include <errno.h>
int main() {
FILE *f = fopen("/etc/issue", "r");
if (!f) {
return errno;
}
return fclose(f);
}
Compile with -g -O3 -Wl,--export-all and run wasm2wat
(func $main (type $t0) (param $p0 i32) (param $p1 i32) (result i32)
call $__original_main)
Now compile with -g -O3 -Wl,--export=main and run wasm2wat
(func $main (type $t2) (param $p0 i32) (param $p1 i32) (result i32)
call $f11)
Why is there a difference?
When compiling a C program with
-Wl,--export-all, more debug info is generated.For example, take this program:
Compile with
-g -O3 -Wl,--export-alland run wasm2watNow compile with
-g -O3 -Wl,--export=mainand run wasm2watWhy is there a difference?