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.
afonso360 requested abrown for a review on PR #7183.
afonso360 requested wasmtime-compiler-reviewers for a review on PR #7183.
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.
afonso360 updated PR #7183.
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.
alexcrichton submitted PR review.
alexcrichton merged PR #7183.
Last updated: Dec 23 2024 at 12:05 UTC