ubsan elfnn-aarch64.c:7142 shift exponent 32 is too large

* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
	of constant shifted left.
This commit is contained in:
Alan Modra 2020-09-02 10:03:14 +09:30
parent 2f26cc79cc
commit 26009aa763
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2020-09-02 Alan Modra <amodra@gmail.com>
* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
of constant shifted left.
2020-09-02 Alan Modra <amodra@gmail.com>
* elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned

View File

@ -7139,7 +7139,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
Try to catch this situation here and provide a more helpful
error message to the user. */
if (addend & ((1UL << howto->rightshift) - 1)
if (addend & (((bfd_vma) 1 << howto->rightshift) - 1)
/* FIXME: Are we testing all of the appropriate reloc
types here ? */
&& (real_r_type == BFD_RELOC_AARCH64_LD_LO19_PCREL