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

x86-64 JIT omits stubs in some cases they're needed #5488

Closed
llvmbot opened this issue Oct 2, 2009 · 2 comments
Closed

x86-64 JIT omits stubs in some cases they're needed #5488

llvmbot opened this issue Oct 2, 2009 · 2 comments
Labels
backend:X86 bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 2, 2009

Bugzilla Link 5116
Resolution FIXED
Resolved on Oct 05, 2009 19:37
Version trunk
OS Linux
Attachments JITTest.cpp addition to provoke the bug, Fix by removing "!TheJIT->isLazyCompilationDisabled()"
Reporter LLVM Bugzilla Contributor
CC @asl

Extended Description

The attached unit test generates the following assembly:

0x00007ffff7f45010 <test+0>: sub $0x8,%rsp
0x00007ffff7f45014 <test+4>: mov $0x7,%edi
0x00007ffff7f45019 <test+9>: callq 0x800000427cd8
0x00007ffff7f4501e <test+14>: add $0x8,%rsp
0x00007ffff7f45022 <test+18>: retq

where the intended target function is actually at address 0x427cd8. This appears to be happening because the actual 64-bit offset gets truncated to 32 bits when it's stored into the callq instruction. This will only happen on x86-64 systems when JIT code is allocated into memory far away from the pre-compiled code segment. If lazy compilation is enabled, or the function is looked up via dlsym instead of addGlobalMapping, the error doesn't happen.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Oct 6, 2009

I've applied the fix in r83353.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#5126

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this issue Nov 3, 2022
[cherry-pick][stable/20220421] [support] Add missing #include <ratio> in ScopedDurationTimer.h
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

1 participant