[llvm-bugs] [Bug 45522] New: wasm_export on symbol with external name linkage isn't preserved

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 13 16:58:25 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45522

            Bug ID: 45522
           Summary: wasm_export on symbol with external name linkage isn't
                    preserved
           Product: lld
           Version: unspecified
          Hardware: Other
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: wasm
          Assignee: unassignedbugs at nondot.org
          Reporter: dan433584 at gmail.com
                CC: llvm-bugs at lists.llvm.org, sbc at chromium.org

Compiling this program (with wasm32-wasi for stdio.h, but the bug isn't
specific to WASI):

#include <stdio.h>

__attribute__((export_name("yellow")))
static void green(void) {
    printf("hello green, exported as yellow\n");
}

int main(void) {
    return 0;
}

produces an executable which doesn't export "yellow".

I expected this to mean that the C symbol "green" is internal, so it can't be
directly linked to from other C files, but that it's treated as live through
the linker and exported from the resulting wasm module as "yellow". Is that
reasonable?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200413/bdb05d1d/attachment.html>


More information about the llvm-bugs mailing list