]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR27597, nios: assertion fail in nios2_elf32_install_imm16
authorAlan Modra <amodra@gmail.com>
Fri, 16 Feb 2024 12:03:29 +0000 (22:33 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 16 Feb 2024 12:19:08 +0000 (22:49 +1030)
commit900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1
tree43015e2d92b43869954c865182c8877633fe4287
parentbf4f7759ed6f7dbba2c7c8b26b3ac3e6f3031cc8
PR27597, nios: assertion fail in nios2_elf32_install_imm16

The assertion in nios2_elf32_install_imm16 triggers when the PLT is
twice the maximum allowable size for a branch from PLTn to reach
.PLTresolve, and on no other call to nios2_elf32_install_imm16.  That
makes the assertion completely useless.  We can handle a PIC PLT
exceeding 0x8000 in size by bouncing branches that won't reach through
previous branches.

PR 27597
* elf32-nios2.c (nios2_elf32_install_imm16): Delete BFD_ASSERT.
(nios2_build_one_stub): Don't bother masking value passed to
nios2_elf32_install_imm16.
(nios2_elf32_finish_dynamic_symbol): Likewise.  Handle overflow
of PLTn branch to .PLTresolve by bouncing through prior branches.
bfd/elf32-nios2.c