Previously we'd hit UB due to an invalid left shift operand.
Also fix the WASM emitter to properly use SLEB128 encoding instead of
ULEB128 encoding for signed fields so that negative numbers don't
result in overly-large values that we can't read back any more.
In passing, don't diagnose a non-canonical ULEB128 that fits in a uint64_t but
has redundant trailing zero bytes.
I'm not sure about this part. The addend is currently defined to be the same data type regardless of the encoding of the relocation itself.
The addend is the value is added to the to the value before writing to relocation location. The encoding used when writing to the relocation address (LEB vs SLEB vs I32, etc) I think is independent of this.
See the definition of addend in https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md