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
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 33915 Build 33914: arc lint + arc unit
Event Timeline
Thanks!
I guess this means we are also missing a test case for --emit-relocs + -fPIC?
llvm/include/llvm/BinaryFormat/Wasm.h | ||
---|---|---|
169 | 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. |
lgtm with comment
lld/test/wasm/emit-relocs-fpic.ll | ||
---|---|---|
1 | 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 | Good catch. Meant to do that, but forgot. Will do and commit. |
There was a small omission in this revision that I fixed up in https://reviews.llvm.org/rG5bb0dcd96ec1.
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)