summaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-05-10 20:46:31 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-05-10 20:46:31 +0000
commit227b1b0012e1e6b406667e15583353bcc4c42094 (patch)
tree0704babf5dd98d87d73cd701ca79380c33af504a /bfd/elf64-x86-64.c
parent03f196a2663f1c27c5e047cd9b45b3358dc3157a (diff)
downloadbinutils-redhat-227b1b0012e1e6b406667e15583353bcc4c42094.tar.gz
Display signed hex number in x32 addend overflow check
bfd/ * elf64-x86-64.c (elf_x86_64_relocate_section): Display signed hex number in x32 addend overflow check. gas/ * config/tc-i386.c (tc_gen_reloc): Display signed hex number in x32 addend overflow check. ld/testsuite/ * ld-x86-64/ilp32-11.d: Updated.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index a9429b8c6c..e98c32512a 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3686,19 +3686,28 @@ elf_x86_64_relocate_section (bfd *output_bfd,
!= (rel->r_addend & 0x80000000))
{
const char *name;
+ long addend = rel->r_addend;
if (h && h->root.root.string)
name = h->root.root.string;
else
name = bfd_elf_sym_name (input_bfd, symtab_hdr,
sym, NULL);
- (*_bfd_error_handler)
- (_("%B: addend %ld in relocation %s against "
- "symbol `%s' at 0x%lx in section `%A' is "
- "out of range"),
- input_bfd, input_section,
- (long) rel->r_addend,
- x86_64_elf_howto_table[r_type].name,
- name, (unsigned long) rel->r_offset);
+ if (addend < 0)
+ (*_bfd_error_handler)
+ (_("%B: addend -0x%lx in relocation %s against "
+ "symbol `%s' at 0x%lx in section `%A' is "
+ "out of range"),
+ input_bfd, input_section, addend,
+ x86_64_elf_howto_table[r_type].name,
+ name, (unsigned long) rel->r_offset);
+ else
+ (*_bfd_error_handler)
+ (_("%B: addend 0x%lx in relocation %s against "
+ "symbol `%s' at 0x%lx in section `%A' is "
+ "out of range"),
+ input_bfd, input_section, addend,
+ x86_64_elf_howto_table[r_type].name,
+ name, (unsigned long) rel->r_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}