aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-05-11 00:50:43 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-05-11 00:50:43 +0000
commit268a8d3ac407c5ce6bd6fe27736a1b9265e84f25 (patch)
tree43a3da45e77d1c335562ffcd1b48dd52a2f8026e /bfd
parent74b1e045f3883b1b07ca5f8f83e7a97948891973 (diff)
downloadgdb-268a8d3ac407c5ce6bd6fe27736a1b9265e84f25.zip
gdb-268a8d3ac407c5ce6bd6fe27736a1b9265e84f25.tar.gz
gdb-268a8d3ac407c5ce6bd6fe27736a1b9265e84f25.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-x86-64.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 806db7f..e776f41 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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>
* elf32-rx.c (rx_elf_object_p): Ignore empty segments.
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index e98c325..1111d77 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3686,7 +3686,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
!= (rel->r_addend & 0x80000000))
{
const char *name;
- long addend = rel->r_addend;
+ int addend = rel->r_addend;
if (h && h->root.root.string)
name = h->root.root.string;
else
@@ -3694,7 +3694,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
sym, NULL);
if (addend < 0)
(*_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 "
"out of range"),
input_bfd, input_section, addend,
@@ -3702,7 +3702,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
name, (unsigned long) rel->r_offset);
else
(*_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 "
"out of range"),
input_bfd, input_section, addend,