Skip to content

Add hint about large binary to relocation out of range error #7

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

Conversation

Forestryks
Copy link

When binary gets too big, we end up getting "relocation out of range" errors. They might be confusing to users, so we add a link to wiki that gives details about this error and how to fix it.

Testing
I used small assembly code to trigger this error:

.section .text
.globl _start
_start:
    jmp far_away

.section .text.far,"ax"
.space 0x80000000
far_away:
    ret

Before this change, linker fails with the following error:

ld.lld: error: test.o:(.text+0x1): relocation R_X86_64_PC32 out of range: 2147483648 is not in [-2147483648, 2147483647]

After this change the error is improved:

ld.lld: error: test.o:(.text+0x1): relocation R_X86_64_PC32 out of range: 2147483648 is not in [-2147483648, 2147483647]; this likely happened because your binary is too big, see https://wiki/x/EQbxK for more info

@poechsel poechsel merged commit 57b330f into main Apr 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants