]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ubsan: nds32 undefined shift
authorAlan Modra <amodra@gmail.com>
Mon, 31 Mar 2025 08:49:28 +0000 (19:19 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 1 Apr 2025 13:15:46 +0000 (23:45 +1030)
commit7bc46c997839cbcb02f987f4cbf776b7a3bcc6f8
tree65d9a3307978d8be953a6b716483d29625bdfe03
parent8c78862afb2664f357fd0c89de5feb6f302afc0a
ubsan: nds32 undefined shift

Avoid implementation defined behaviour right shift of negative values,
and undefined behaviour left shift of negative values.  While this
change might give different results in the top bit of a bfd_vma
(rightshift is 1), that doesn't matter as only the bottom 8 bits of
the relocation are used.

* elf32-nds32.c (nds32_elf_do_9_pcrel_reloc): Calculate relocation
using a bfd_vma type.
bfd/elf32-nds32.c