Skip to content

debug info depends on -Wl,--export= #129

@jendrikw

Description

@jendrikw

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions