[PATCH] x32: Allow R_X86_64_PC64 for SFrame V3

H.J. Lu hjl.tools@gmail.com
Mon Jan 19 02:19:14 GMT 2026


SFrame V3 generates R_X86_64_PC64 relocation, instead of R_X86_64_PC32,
in .sframe section for x86-64.  Although x32 doesn't support SFrame,
.sframe section can be found in x32 object converted from x86-64 object
with objcopy, which only changes the ELF file class from ELFCLASS64 to
ELFCLASS32 with all section contents unchanged.

Update elf_x86_64_scan_relocs to allow R_X86_64_PC64 for x32 so that
x32 object file with .sframe section can be used as x32 linker input.

bfd/

PR ld/33807
* elf64-x86-64.c (elf_x86_64_scan_relocs): Allow R_X86_64_PC64
for x32.

ld/

PR ld/33807
* testsuite/ld-x86-64/sframe.rd: New file.
* testsuite/ld-x86-64/sframe.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/33807 tests.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x32-Allow-R_X86_64_PC64-for-SFrame-V3.patch
Type: text/x-patch
Size: 3838 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260119/5667026f/attachment.bin>


More information about the Binutils mailing list