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

            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: unassignedb...@nondot.org
          Reporter: ahee...@gmail.com
                CC: llvm-bugs@lists.llvm.org, oeysymo...@gmail.com,
                    s...@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:

main.c:

int test(int);

int main() {
  test(1);
  return 0;
}

test.c:

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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to