diff options
author | Alan Modra <amodra@gmail.com> | 2020-09-01 08:03:52 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-09-01 16:02:48 +0930 |
commit | 00c91124d44f799a4fb9cd45a0ef44dc47ab1b1a (patch) | |
tree | b431513d4ff0333f7eaccf5284c18948b18f5eb3 /bfd | |
parent | efe24f056fd7dd28d231b34c4b1fc5e6aaca4168 (diff) | |
download | gdb-00c91124d44f799a4fb9cd45a0ef44dc47ab1b1a.zip gdb-00c91124d44f799a4fb9cd45a0ef44dc47ab1b1a.tar.gz gdb-00c91124d44f799a4fb9cd45a0ef44dc47ab1b1a.tar.bz2 |
PR26423 UBSAN: elf32-arm.c:10237 left shift cannot be represented
PR 26423
* elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 861655c..2091870 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 2499189..4366b76 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 |