From: Alan Modra Date: Mon, 25 Oct 2021 01:09:39 +0000 (+1030) Subject: ubsan: _bfd_xcoff64_swap_aux_in left shift of negative value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e5a28be0fafd49bd5a64f38c66631196b534f57;p=binutils-gdb.git ubsan: _bfd_xcoff64_swap_aux_in left shift of negative value * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Use bfd_vma for h. --- diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index 04e0798bf69..8c206959fd3 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);