From 9911c0fc433eef4a6d7dbf100c926d65d2fd868b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 21 Dec 2012 20:54:59 +0000 Subject: [PATCH] Check R_X86_64_standard for unrecognized relocation * elf64-x86-64.c (elf_x86_64_relocate_section): Check R_X86_64_standard instead of R_X86_64_max for unrecognized relocation. --- bfd/ChangeLog | 6 ++++++ bfd/elf64-x86-64.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 48f94da..ec7d98f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2012-12-21 H.J. Lu + * elf64-x86-64.c (elf_x86_64_relocate_section): Check + R_X86_64_standard instead of R_X86_64_max for unrecognized + relocation. + +2012-12-21 H.J. Lu + PR ld/14980 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Properly adjust h->plt.refcount. diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 11ec917..92bf991 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -3207,8 +3207,11 @@ elf_x86_64_relocate_section (bfd *output_bfd, || r_type == (int) R_X86_64_GNU_VTENTRY) continue; - if (r_type >= R_X86_64_max) + if (r_type >= (int) R_X86_64_standard) { + (*_bfd_error_handler) + (_("%B: unrecognized relocation (0x%x) in section `%A'"), + input_bfd, input_section, r_type); bfd_set_error (bfd_error_bad_value); return FALSE; } -- 2.7.4