Skip to content

feat: implement R_X86_64_CODE_* relocations with relaxations#1632

Merged
lapla-cogito merged 8 commits into
wild-linker:mainfrom
vishruth-thimmaiah:code_-relocs
Mar 6, 2026
Merged

feat: implement R_X86_64_CODE_* relocations with relaxations#1632
lapla-cogito merged 8 commits into
wild-linker:mainfrom
vishruth-thimmaiah:code_-relocs

Conversation

@vishruth-thimmaiah

@vishruth-thimmaiah vishruth-thimmaiah commented Mar 3, 2026

Copy link
Copy Markdown
Member

closes #1299

This PR adds support for the R_X86_64_CODE_* relocations, with relaxations wherever possible.

Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
@vishruth-thimmaiah

Copy link
Copy Markdown
Member Author

I've raised this PR as a draft as the latest stable release of object.rs doesnt include these relocs, which is why Ive used their hex values instead.

@davidlattimore davidlattimore left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Can you add a test that uses these relaxations? It might need to be written in asm if you can't get the C compiler to produce them.

Comment thread libwild/src/elf_x86_64.rs Outdated
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
@vishruth-thimmaiah vishruth-thimmaiah marked this pull request as ready for review March 4, 2026 13:07
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
@lapla-cogito

Copy link
Copy Markdown
Member

In Wild, we run mold tests via CI, and tests related to APX have started passing (see "Check tests that should fail still fail" in this). Could you remove these tests from wild/tests/external_tests/mold_skip_tests.toml? (BTW, in such cases, CI isn't marked as failed because false positives occasionally occur)

Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
Comment thread linker-diff/src/lib.rs Outdated
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>

@lapla-cogito lapla-cogito left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lapla-cogito lapla-cogito merged commit 72fe71c into wild-linker:main Mar 6, 2026
20 checks 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.

Support R_X86_64_CODE_6_GOTTPOFF relocations

3 participants