mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
Use int and bfd_signed_vma in x32 addend overflow check
bfd/ * elf64-x86-64.c (elf_x86_64_relocate_section): Use int in x32 addend overflow check. gas/ * config/tc-i386.c (tc_gen_reloc): Use bfd_signed_vma in x32 addend overflow check.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* elf64-x86-64.c (elf_x86_64_relocate_section): Use int in x32
|
||||||
|
addend overflow check.
|
||||||
|
|
||||||
2012-05-10 DJ Delorie <dj@redhat.com>
|
2012-05-10 DJ Delorie <dj@redhat.com>
|
||||||
|
|
||||||
* elf32-rx.c (rx_elf_object_p): Ignore empty segments.
|
* elf32-rx.c (rx_elf_object_p): Ignore empty segments.
|
||||||
|
@ -3686,7 +3686,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
|
|||||||
!= (rel->r_addend & 0x80000000))
|
!= (rel->r_addend & 0x80000000))
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
long addend = rel->r_addend;
|
int addend = rel->r_addend;
|
||||||
if (h && h->root.root.string)
|
if (h && h->root.root.string)
|
||||||
name = h->root.root.string;
|
name = h->root.root.string;
|
||||||
else
|
else
|
||||||
@ -3694,7 +3694,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
|
|||||||
sym, NULL);
|
sym, NULL);
|
||||||
if (addend < 0)
|
if (addend < 0)
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
(_("%B: addend -0x%lx in relocation %s against "
|
(_("%B: addend -0x%x in relocation %s against "
|
||||||
"symbol `%s' at 0x%lx in section `%A' is "
|
"symbol `%s' at 0x%lx in section `%A' is "
|
||||||
"out of range"),
|
"out of range"),
|
||||||
input_bfd, input_section, addend,
|
input_bfd, input_section, addend,
|
||||||
@ -3702,7 +3702,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
|
|||||||
name, (unsigned long) rel->r_offset);
|
name, (unsigned long) rel->r_offset);
|
||||||
else
|
else
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
(_("%B: addend 0x%lx in relocation %s against "
|
(_("%B: addend 0x%x in relocation %s against "
|
||||||
"symbol `%s' at 0x%lx in section `%A' is "
|
"symbol `%s' at 0x%lx in section `%A' is "
|
||||||
"out of range"),
|
"out of range"),
|
||||||
input_bfd, input_section, addend,
|
input_bfd, input_section, addend,
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* config/tc-i386.c (tc_gen_reloc): Use bfd_signed_vma in x32
|
||||||
|
addend overflow check.
|
||||||
|
|
||||||
2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
|
2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* config/tc-i386.c (tc_gen_reloc): Display signed hex number in
|
* config/tc-i386.c (tc_gen_reloc): Display signed hex number in
|
||||||
|
@ -9177,16 +9177,18 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
|
|||||||
/* Check addend overflow. */
|
/* Check addend overflow. */
|
||||||
if (!fits_in_signed_long (fixp->fx_offset))
|
if (!fits_in_signed_long (fixp->fx_offset))
|
||||||
{
|
{
|
||||||
long long addend = fixp->fx_offset;
|
bfd_signed_vma addend = fixp->fx_offset;
|
||||||
if (addend < 0)
|
if (addend < 0)
|
||||||
as_bad_where (fixp->fx_file, fixp->fx_line,
|
as_bad_where (fixp->fx_file, fixp->fx_line,
|
||||||
_("cannot represent relocation %s with "
|
_("cannot represent relocation %s with "
|
||||||
"addend -0x%llx in x32 mode"),
|
"addend -0x%" BFD_VMA_FMT "x in x32 "
|
||||||
|
"mode"),
|
||||||
bfd_get_reloc_code_name (code), -addend);
|
bfd_get_reloc_code_name (code), -addend);
|
||||||
else
|
else
|
||||||
as_bad_where (fixp->fx_file, fixp->fx_line,
|
as_bad_where (fixp->fx_file, fixp->fx_line,
|
||||||
_("cannot represent relocation %s with "
|
_("cannot represent relocation %s with "
|
||||||
"addend 0x%llx in x32 mode"),
|
"addend 0x%" BFD_VMA_FMT "x in x32 "
|
||||||
|
"mode"),
|
||||||
bfd_get_reloc_code_name (code), addend);
|
bfd_get_reloc_code_name (code), addend);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user