[ARM] Add IFunc support for static links#1251
Open
Parth (parth-07) wants to merge 1 commit into
Open
Conversation
5ec3a13 to
d3cfef9
Compare
d3cfef9 to
39c86d6
Compare
39c86d6 to
b04278a
Compare
Eli Friedman (efriedma-quic)
approved these changes
Jun 10, 2026
quic-areg
reviewed
Jun 10, 2026
2af6d04 to
9ff965c
Compare
quic-areg
approved these changes
Jun 17, 2026
9ff965c to
9d8ed29
Compare
9d8ed29 to
e94b8c4
Compare
Contributor
Author
|
Shankar Easwaran (@quic-seaswara) can this PR be merged? |
This commit adds GNU IFunc support for ARM32 static executables, bringing ARM to parity with AArch64 and RISCV. Relocations are classified into four categories (control-flow, absolute data, PC-relative address-forming, and GOT-based). Relocations outside any valid category is warned as invalid; those in a valid category that eld cannot/does-not properly support is reported as unsupported. The MOVW_PREL / THM_MOVW_PREL apply functions are fixed to redirect S to PLT[fn] whenever PLT slot is available, matching the existing behaviour of their ABS counterparts. The R_ARM_TARGET1 -> R_ARM_ABS32 rewrite is centralised into scanRelocation rather than repeated across scanLocalReloc, scanGlobalReloc, and handleScanForNonPreemptibleIFunc. The __rel_iplt_start / __rel_iplt_end symbols are fixed to match RISCV: NOTYPE LOCAL DEFAULT with a section index pointing to .rel.plt, rather than OBJECT GLOBAL ABS. IFunc behaviour across all relevant ARM relocation categories is documented in IFunc.md. Signed-off-by: Parth Arora <partaror@qti.qualcomm.com>
e94b8c4 to
9623460
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds GNU IFunc support for ARM32 static executables,
bringing ARM to parity with AArch64 and RISCV.
Relocations are classified into four categories (control-flow, absolute data,
PC-relative address-forming, and GOT-based). Relocations outside any
valid category is warned as invalid; those in a valid category that eld
cannot/does-not properly support is reported as unsupported.
The MOVW_PREL / THM_MOVW_PREL apply functions are fixed to redirect S to
PLT[fn] whenever PLT slot is available, matching the existing behaviour of
their ABS counterparts.
The R_ARM_TARGET1 -> R_ARM_ABS32 rewrite is centralised into
scanRelocation rather than repeated across scanLocalReloc, scanGlobalReloc,
and handleScanForNonPreemptibleIFunc.
The __rel_iplt_start / __rel_iplt_end symbols are fixed to match RISCV:
NOTYPE LOCAL DEFAULT with a section index pointing to .rel.plt, rather
than OBJECT GLOBAL ABS.
IFunc behaviour across all relevant ARM relocation categories is documented in
IFunc.md.