From: Alan Modra Date: Mon, 31 Aug 2020 22:33:52 +0000 (+0930) Subject: PR26423 UBSAN: elf32-arm.c:10237 left shift cannot be represented X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00c91124d44f799a4fb9cd45a0ef44dc47ab1b1a;p=binutils-gdb.git PR26423 UBSAN: elf32-arm.c:10237 left shift cannot be represented PR 26423 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 861655c9de0..20918707f28 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2020-09-01 Alan Modra + + PR 26423 + * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift. + 2020-08-31 Alan Modra PR 26493 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 24991898f70..4366b766361 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -10234,7 +10234,7 @@ calculate_group_reloc_mask (bfd_vma value, int n, bfd_vma *final_residual) /* Determine the most significant bit in the residual and align the resulting value to a 2-bit boundary. */ for (msb = 30; msb >= 0; msb -= 2) - if (residual & (3 << msb)) + if (residual & (3u << msb)) break; /* The desired shift is now (msb - 6), or zero, whichever