[PATCH] D155542: [lld][WebAssembly] Fix func reloc for internal GOT with extended-const

YAMAMOTO Takashi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 20:39:22 PDT 2023


yamt added inline comments.


================
Comment at: lld/wasm/SyntheticSections.cpp:510
+      writeU8(os, is64 ? WASM_OPCODE_I64_ADD : WASM_OPCODE_I32_ADD, "add");
+      writeU8(os, WASM_OPCODE_END, "opcode:end");
     } else {
----------------
sbc100 wrote:
> Can we combine these two blocks into a single `if (config->extendedConst && config->isPic)` block that handles these?  (since they share most of the code).
> 
> Also, shouldn't there be a corresponding change to __wasm_apply_global_relocs to avoid applying a relocation?
> 
> Also, can you add a test for this (I would imagine by modifying `lld/test/wasm/pie.ll` perhaps?
> 
> Can we combine these two blocks into a single `if (config->extendedConst && config->isPic)` block that handles these?  (since they share most of the code).

ok

> Also, shouldn't there be a corresponding change to __wasm_apply_global_relocs to avoid applying a relocation?

that part is already done. that's why it's broken and i noticed it.

> Also, can you add a test for this (I would imagine by modifying `lld/test/wasm/pie.ll` perhaps?

ok. i will try.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155542/new/

https://reviews.llvm.org/D155542



More information about the llvm-commits mailing list