[lld] [lld][WebAssembly] Add missing relocation types to the --compress-relocations path (PR #144578)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 11:56:48 PDT 2025


================
@@ -239,11 +239,18 @@ static unsigned writeCompressedReloc(uint8_t *buf, const WasmRelocation &rel,
     return encodeULEB128(value, buf);
   case R_WASM_TABLE_INDEX_SLEB:
   case R_WASM_TABLE_INDEX_SLEB64:
+  case R_WASM_TABLE_INDEX_REL_SLEB64:
   case R_WASM_MEMORY_ADDR_SLEB:
   case R_WASM_MEMORY_ADDR_SLEB64:
+  case R_WASM_MEMORY_ADDR_REL_SLEB:
+  case R_WASM_MEMORY_ADDR_REL_SLEB64:
+  case R_WASM_MEMORY_ADDR_TLS_SLEB:
+  case R_WASM_MEMORY_ADDR_TLS_SLEB64:
+  case R_WASM_TABLE_INDEX_REL_SLEB:
     return encodeSLEB128(static_cast<int64_t>(value), buf);
   default:
----------------
SingleAccretion wrote:

That would be very good indeed (though I am not sure if it can be made to work seeing as there are "incomplete" switches in e. g. Relocations.cpp). It looks like I'll need to test it in a separate change because my local incremental build of LLVM has been purged by the pull (that was needed to resolve some conflicts).

https://github.com/llvm/llvm-project/pull/144578


More information about the llvm-commits mailing list