The list of relocations with addend in lld was missing R_WASM_MEMORY_ADDR_REL_SLEB,
causing wasm-ld to generate corrupted output. This fixes that problem and while
we're at it pulls the list of such relocations into the Wasm.h header, to avoid
duplicating it in multiple places.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks!
I guess this means we are also missing a test case for --emit-relocs + -fPIC?
llvm/include/llvm/BinaryFormat/Wasm.h | ||
---|---|---|
169 ↗ | (On Diff #206147) | Rather than adding methods to this struct can you implement in the same way that relocTypetoString is below? Perhaps we can make them methods later, but I'm currently a fan of keeping the struct definitions clean so they can be easily matched with the binary spec. |
Comment Actions
lgtm with comment
lld/test/wasm/emit-relocs-fpic.ll | ||
---|---|---|
1 ↗ | (On Diff #206550) | Can you name this file .s since it contains asm? (I think this is the first of the .s files tests in lld so you will also need to add .s to the list of suffixes in lld/test/wasm/lit.local.cfg) |
lld/test/wasm/emit-relocs-fpic.ll | ||
---|---|---|
1 ↗ | (On Diff #206550) | Good catch. Meant to do that, but forgot. Will do and commit. |
Comment Actions
There was a small omission in this revision that I fixed up in https://reviews.llvm.org/rG5bb0dcd96ec1.