Skip to content

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.

3 participants