PR26423 UBSAN: elf32-arm.c:10237 left shift cannot be represented

PR 26423
	* elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
This commit is contained in:
Alan Modra
2020-09-01 08:03:52 +09:30
parent efe24f056f
commit 00c91124d4
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2020-09-01 Alan Modra <amodra@gmail.com>
PR 26423
* elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
2020-08-31 Alan Modra <amodra@gmail.com>
PR 26493

View File

@ -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