Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RyuJIT] Fix rel32 for calls/data #49549

Merged
merged 3 commits into from
Mar 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4516,7 +4516,12 @@ GenTree* Lowering::LowerNonvirtPinvokeCall(GenTreeCall* call)
switch (lookup.accessType)
{
case IAT_VALUE:
if (!IsCallTargetInRange(addr))
// IsCallTargetInRange always return true on x64. It wants to use rip-based addressing
// for this call. Unfortunately, in case of pinvokes (+suppressgctransition) to external libs
// (e.g. kernel32.dll) the relative offset is unlikely to fit into int32 and we will have to
// turn fAllowRel32 off globally.
if ((call->IsSuppressGCTransition() && !comp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT)) ||
!IsCallTargetInRange(addr))
{
result = AddrGen(addr);
}
Expand Down