[llvm-bugs] [Bug 45645] New: Using --relocatable with mismatching function signatures crashes

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 23 00:29:28 PDT 2020


            Bug ID: 45645
           Summary: Using --relocatable with mismatching function
                    signatures crashes
           Product: lld
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: wasm
          Assignee: unassignedbugs at nondot.org
          Reporter: aheejin at gmail.com
                CC: llvm-bugs at lists.llvm.org, oeysymontt at gmail.com,
                    sbc at chromium.org

When function return types mismatch between its definition and declaration, if
we pass '--relocatable' to wasm-ld, it crashes. If we don't use '--relocatable'
it only prints warnings but runs successfully.

- Test cases:


int test(int);

int main() {
  return 0;


void test (int n) {

- Commands to reproduce:
emcc -c test.c (You can use clang too)
emcc -c main.c
wasm-ld --relocatable test.o main.o -o t.so

- Error message:
wasm-ld: ../lld/wasm/Symbols.cpp:144: uint32_t
lld::wasm::Symbol::getOutputSymbolIndex() const: Assertion `outputSymbolIndex
!= INVALID_INDEX' failed

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/20200423/73841ab6/attachment.html>

More information about the llvm-bugs mailing list