Skip to content

[ARM] Add IFunc support for static links#1251

Open
Parth (parth-07) wants to merge 1 commit into
qualcomm:mainfrom
parth-07:ARMStaticLinks
Open

[ARM] Add IFunc support for static links#1251
Parth (parth-07) wants to merge 1 commit into
qualcomm:mainfrom
parth-07:ARMStaticLinks

Conversation

@parth-07

@parth-07 Parth (parth-07) commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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.

@parth-07 Parth (parth-07) force-pushed the ARMStaticLinks branch 2 times, most recently from 5ec3a13 to d3cfef9 Compare June 10, 2026 15:11
@parth-07 Parth (parth-07) changed the title [ARM] Add complete support for IFunc in ARM static links [ARM] Add IFunc support for static links Jun 10, 2026
@parth-07 Parth (parth-07) marked this pull request as ready for review June 10, 2026 15:12
Comment thread lib/Target/ARM/ARMRelocator.cpp
@parth-07 Parth (parth-07) force-pushed the ARMStaticLinks branch 2 times, most recently from 2af6d04 to 9ff965c Compare June 17, 2026 15:52
@parth-07

Copy link
Copy Markdown
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>
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