[PATCH] x86: Disallow ".long foo@PLT - .L4" for PLT32 relocation
H.J. Lu
hjl.tools@gmail.com
Thu Jul 30 23:09:25 GMT 2026
Disallow ".long foo@PLT - .L4" and only allow ".slong foo@PLT - .L4" for
PLT32 relocation.
gas/
PR gas/34423
* config/tc-i386.c (cons_slong): New.
(x86_cons): Return BFD_RELOC_X86_64_PC32_TO_PLT32 or
BFD_RELOC_386_PC32_TO_PLT32 only if cons_slong is true.
(signed_cons): Set cons_slong to true before calling cons and
set it to false afterwards.
(tc_gen_reloc): Update BFD_RELOC_X86_64_PC32_TO_PLT32 comments.
* testsuite/gas/i386/ilp32/reloc64.l: Revert commit 53902b30c66.
* testsuite/gas/i386/ilp32/reloc64.s: Likewise.
* testsuite/gas/i386/reloc32.l: Likewise.
* testsuite/gas/i386/reloc32.s: Likewise.
* testsuite/gas/i386/reloc64.l: Likewise.
* testsuite/gas/i386/plt.s: Replace .long with .slong.
* testsuite/gas/i386/x86-64-jump-table.s: Likewise.
ld/
PR gas/34423
* testsuite/ld-x86-64/x86-64-jump-table.s: Replace .long with
.slong.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Disallow-.long-foo-PLT-.L4-for-PLT32-relocation.patch
Type: text/x-patch
Size: 8225 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260731/3bd9f43a/attachment.bin>
More information about the Binutils
mailing list