]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86: Return error for invalid relocation offset
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 9 Feb 2025 07:13:38 +0000 (15:13 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 9 Feb 2025 22:35:34 +0000 (06:35 +0800)
commitd4d66eb19fd5ace50e1d40f53f14e76fe8b8963d
tree813bb478d1f0aa46a51b5763e7fe7af2453bc65c
parentdd39a8c388dd888463281931c10ad7df0005a675
x86: Return error for invalid relocation offset

Return error if relocation offset + relocation size > section size.

bfd/

PR ld/32665
* elf32-i386.c (elf_i386_scan_relocs): Return error for invalid
relocation offset.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.

ld/

PR ld/32665
* testsuite/ld-x86-64/pr32665.err: New file.
* testsuite/ld-x86-64/pr32665.o.bz2: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/32665 test.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
bfd/elf32-i386.c
bfd/elf64-x86-64.c
ld/testsuite/ld-x86-64/pr32665.err [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr32665.o.bz2 [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp