-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Relocation R_X86_64_32S out of range #70992
Comments
I figured it out! The core crate i'm linking with is built with different code-model and relocation-model. After re-build them with same code-model and relocation-model, everything works. |
Can you share about your resolution step?I have the same question with you. |
You must use the same code-model and relocation-model when you building your core crate. The step to building core crate with custom target is quite hard and I still not figure it out, I just copy sysroot from some others project. |
Thanke you for your response. |
About the custom core crate, I can't remember anymore since it too long ago. As i said, I use cargo-xbuild to build the core crate for me and I just copy sysroot folder for private use after that.
After that, use it as follow:
|
Thank you |
@polyproline, as some note, you should back up your sysroot folder if it works because this is just a work around and cargo-xbuild project can change their way of doing thing anytime and it may break everything. This happened to me once until I found out what they had changed and find my way to work around that. |
I tried to link some code to large address using custom linker script but it says
'relocation R_X86_64_32S out of range'
linker script:
command:
rustc main.rs -C link-arg='--script=link.ld' -C code-model=large
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: