This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Check R_X86_64_standard for unrecognized relocation
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Sat, 22 Dec 2012 10:25:57 -0800
- Subject: Re: PATCH: Check R_X86_64_standard for unrecognized relocation
- References: <20121221205618.GA20749@intel.com>
On Fri, Dec 21, 2012 at 12:56 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> I checked in this patch to check R_X86_64_standard for unrecognized
> relocation. I also added an error message when it happens.
>
>
> H.J.
> 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 <hongjiu.lu@intel.com>
>
> + * 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 <hongjiu.lu@intel.com>
> +
> 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;
> }
I also checked it into 2.23 branch.
--
H.J.