aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff64-rs6000.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-10-25 11:39:39 +1030
committerAlan Modra <amodra@gmail.com>2021-10-25 11:41:52 +1030
commit1e5a28be0fafd49bd5a64f38c66631196b534f57 (patch)
tree6c615b9ec8b6c3352603915d93c7fa32843af9a7 /bfd/coff64-rs6000.c
parentb920bc37223df1213180ec0b13eb0828c015d34f (diff)
downloadgdb-1e5a28be0fafd49bd5a64f38c66631196b534f57.zip
gdb-1e5a28be0fafd49bd5a64f38c66631196b534f57.tar.gz
gdb-1e5a28be0fafd49bd5a64f38c66631196b534f57.tar.bz2
ubsan: _bfd_xcoff64_swap_aux_in left shift of negative value
* coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Use bfd_vma for h.
Diffstat (limited to 'bfd/coff64-rs6000.c')
-rw-r--r--bfd/coff64-rs6000.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index 04e0798..8c20695 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -410,11 +410,8 @@ _bfd_xcoff64_swap_aux_in (bfd *abfd, void *ext1, int type ATTRIBUTE_UNUSED,
if (auxtype != _AUX_CSECT)
goto error;
- bfd_signed_vma h = 0;
- bfd_vma l = 0;
-
- h = H_GET_S32 (abfd, ext->x_csect.x_scnlen_hi);
- l = H_GET_32 (abfd, ext->x_csect.x_scnlen_lo);
+ bfd_vma h = H_GET_S32 (abfd, ext->x_csect.x_scnlen_hi);
+ bfd_vma l = H_GET_32 (abfd, ext->x_csect.x_scnlen_lo);
in->x_csect.x_scnlen.l = h << 32 | (l & 0xffffffff);