Fix an integer overflow in RISC-V relocation handling
* elfnn-riscv.c (bfd_riscv_get_max_alignment): Return bfd_vma instead of unsigned int.
This commit is contained in:
parent
45f764234a
commit
1d61f7949f
|
@ -1,3 +1,8 @@
|
|||
2016-12-20 Andrew Waterman <andrew@sifive.com>
|
||||
|
||||
* elfnn-riscv.c (bfd_riscv_get_max_alignment): Return bfd_vma
|
||||
instead of unsigned int.
|
||||
|
||||
2016-12-20 Andrew Waterman <andrew@sifive.com>
|
||||
Kuan-Lin Chen <kuanlinchentw@gmail.com>
|
||||
|
||||
|
|
|
@ -2759,7 +2759,7 @@ _bfd_riscv_relax_call (bfd *abfd, asection *sec, asection *sym_sec,
|
|||
|
||||
/* Traverse all output sections and return the max alignment. */
|
||||
|
||||
static unsigned int
|
||||
static bfd_vma
|
||||
_bfd_riscv_get_max_alignment (asection *sec)
|
||||
{
|
||||
unsigned int max_alignment_power = 0;
|
||||
|
@ -2771,7 +2771,7 @@ _bfd_riscv_get_max_alignment (asection *sec)
|
|||
max_alignment_power = o->alignment_power;
|
||||
}
|
||||
|
||||
return 1 << max_alignment_power;
|
||||
return (bfd_vma) 1 << max_alignment_power;
|
||||
}
|
||||
|
||||
/* Relax non-PIC global variable references. */
|
||||
|
|
Loading…
Reference in New Issue