aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-04-29 08:33:51 +0000
committerNick Clifton <nickc@redhat.com>2013-04-29 08:33:51 +0000
commit7fcfd62ddcaf55a68737baf108e3a7fe3764736e (patch)
tree0d84752d49798331324ab73f34f0b2eb9606ce58 /bfd
parent47d21dc5204be6dcb0c9388f0af24a0c829ae149 (diff)
downloadgdb-7fcfd62ddcaf55a68737baf108e3a7fe3764736e.zip
gdb-7fcfd62ddcaf55a68737baf108e3a7fe3764736e.tar.gz
gdb-7fcfd62ddcaf55a68737baf108e3a7fe3764736e.tar.bz2
* elf64-aarch64.c (elf64_aarch64_check_relocs): Move relocation
error check up and add error message.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-aarch64.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 12a44f4..14abe01 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-29 Will Newton <will.newton@linaro.org>
+
+ * elf64-aarch64.c (elf64_aarch64_check_relocs): Move relocation
+ error check up and add error message.
+
2013-04-26 Will Newton <will.newton@linaro.org>
* elf64-aarch64.c (elf64_aarch64_check_relocs): Remove dead code.
diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c
index 9a6d8b4..e3cae95 100644
--- a/bfd/elf64-aarch64.c
+++ b/bfd/elf64-aarch64.c
@@ -4306,6 +4306,14 @@ elf64_aarch64_relocate_section (bfd *output_bfd,
bfd_reloc.howto = elf64_aarch64_howto_from_type (r_type);
howto = bfd_reloc.howto;
+ if (howto == NULL)
+ {
+ (*_bfd_error_handler)
+ (_("%B: unrecognized relocation (0x%x) in section `%A'"),
+ input_bfd, input_section, r_type);
+ return FALSE;
+ }
+
h = NULL;
sym = NULL;
sec = NULL;
@@ -4330,12 +4338,6 @@ elf64_aarch64_relocate_section (bfd *output_bfd,
return FALSE;
}
- if (r_type >= R_AARCH64_dyn_max)
- {
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
-
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
}
else