diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-05-10 20:46:34 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-05-10 20:46:34 +0000 |
commit | 6f2c9068edbe878242f511eb13f03f1a6945f96c (patch) | |
tree | 869d00e1dab70bb53720caacba9a8d1b69b3bb70 /bfd | |
parent | 95554aad6c78f459750b8edda9e1832063083132 (diff) | |
download | gdb-6f2c9068edbe878242f511eb13f03f1a6945f96c.zip gdb-6f2c9068edbe878242f511eb13f03f1a6945f96c.tar.gz gdb-6f2c9068edbe878242f511eb13f03f1a6945f96c.tar.bz2 |
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')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 25 |
2 files changed, 22 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fa2f5fa..a46ed85 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2012-05-10 H.J. Lu <hongjiu.lu@intel.com> + * elf64-x86-64.c (elf_x86_64_relocate_section): Display signed + hex number in x32 addend overflow check. + +2012-05-10 H.J. Lu <hongjiu.lu@intel.com> + * elf64-x86-64.c (elf_x86_64_reloc_type_class): Handle R_X86_64_RELATIVE64. diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index a9429b8..e98c325 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; } |