https://bugs.llvm.org/show_bug.cgi?id=35369
Bug ID: 35369
Summary: LLD wasm: alignment assert + a segfault
Product: lld
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedb...@nondot.org
Reporter: a...@crichton.co
CC: llvm-bugs@lists.llvm.org
Created attachment 19448
--> https://bugs.llvm.org/attachment.cgi?id=19448&action=edit
test object file that fails
I've experimented trying to integrate LLD into Rust's support for WebAssembly
but unfortunately the "hello world" was generating a few asserts and segfaults
in LLD. For reduction I've extracted just one object file on the linker line
which reproduces the issue.
If I execute:
$ wasm-ld test.o -o test --allow-undefined
it'll fail with:
wasm-ld: /home/alex/code/llvm/include/llvm/Support/MathExtras.h:678:
uint64_t llvm::alignTo(uint64_t, uint64_t, uint64_t): Assertion `Align != 0u &&
"Align can't be 0."' failed.
I tried tracing in gdb and it looks like this is a case where the data section
has an alignment of 0 (unsure why). I then attempted to apply a small patch [1]
but then lld segfaulted right afterwards. Then I gave up and decided to open a
bug!
To be clear the object file here doesn't actually do anything useful. This was
part of a much larger link line and this is just one object file reduced. If
it's helpful I can provide all the various inputs as well!
[1]: https://gist.github.com/alexcrichton/8f5ddc7778586011eabe58aa2e11baeb
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs