[MonoVM] Fix calculation of code size for AOT assemblies mixing JIT and LLVM #58491
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #56100
Here's a little bit of background on the problem. When multiple AOT modules got linked into the same executable for iOS/MacCatalyst the LLVM and JIT code sections of different modules got interleaved. The resulting AOT module info looks something like this:
The previous code incorrectly assumed that the third method had a code size
0x104c027c8 - 0x101002470
. When inserted into lookup table any of the AOT code inside the range0x1010035e0 (JIT code end) - 0x104c027c8 (LLVM code start)
would incorrectly end up being mapped to the last JIT method.(Note: The JIT name here is misleading.)