Stream: git-wasmtime

Topic: wasmtime / PR #7183 cranelift: Group labels by FuncId ins...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 22:44):

afonso360 opened PR #7183 from afonso360:object-label-better-matching to bytecodealliance:main:

:wave: Hey,

This addresses an issue that was exposed by cg_clif when using RISC-V with GOT relocations.

Apparently we allow multiple functions with the same name to coexist within the same module. Currently we deduplicate labels in the object backend by function name and label offset. This caused a label confusion issue when two functions with the same tried to emit a label at the same offset. The result was that one function referenced a label in the second one causing a very confusing relocation.

The solution here is to instead use FuncId which is assigned when the function is defined and guaranteed to be unique.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 22:44):

afonso360 requested abrown for a review on PR #7183.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 22:44):

afonso360 requested wasmtime-compiler-reviewers for a review on PR #7183.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 22:46):

afonso360 edited PR #7183:

:wave: Hey,

This addresses an issue that was exposed by cg_clif when using RISC-V with GOT relocations.

Apparently we allow multiple functions with the same name to coexist within the same module. Currently we deduplicate labels in the object backend by function name and label offset.

This caused a label confusion issue when two functions with the same name tried to emit a label at the same offset. The result was that one function referenced a label in the second one causing a very confusing relocation.

The solution here is to instead use FuncId which is assigned when the function is defined and guaranteed to be unique.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 22:51):

afonso360 updated PR #7183.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 22:53):

afonso360 edited PR #7183:

:wave: Hey,

This addresses an issue that was exposed by cg_clif when using RISC-V with GOT relocations.

Apparently we allow multiple functions with the same name to coexist within the same module. Currently we deduplicate labels in the object backend by function name and label offset.

This caused a label confusion issue when two functions with the same name tried to emit a label at the same offset. The result was that one function referenced a label in the second one causing a very confusing relocation.

The solution here is to instead use FuncId which is assigned when the function is first declared and guaranteed to be unique.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2023 at 03:10):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2023 at 03:57):

alexcrichton merged PR #7183.


Last updated: Nov 22 2024 at 16:03 UTC