mn10300: ubsan: shift exponent too large
* elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate alignment from reloc addend after reloc type R_MN10300_ALIGN is found.
This commit is contained in:
parent
737d219034
commit
8f383897b6
2 changed files with 16 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
2020-08-31 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
|
||||
alignment from reloc addend after reloc type R_MN10300_ALIGN is
|
||||
found.
|
||||
|
||||
2020-08-30 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26435
|
||||
|
|
|
@ -2418,17 +2418,19 @@ mn10300_elf_relax_delete_bytes (bfd *abfd,
|
|||
are deleting. */
|
||||
for (; irel < irelend; irel++)
|
||||
{
|
||||
int alignment = 1 << irel->r_addend;
|
||||
|
||||
if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_ALIGN
|
||||
&& irel->r_offset > addr
|
||||
&& irel->r_offset < toaddr
|
||||
&& (count < alignment
|
||||
|| alignment % count != 0))
|
||||
&& irel->r_offset < toaddr)
|
||||
{
|
||||
irelalign = irel;
|
||||
toaddr = irel->r_offset;
|
||||
break;
|
||||
int alignment = 1 << irel->r_addend;
|
||||
|
||||
if (count < alignment
|
||||
|| alignment % count != 0)
|
||||
{
|
||||
irelalign = irel;
|
||||
toaddr = irel->r_offset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue