This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: elf32-arm.c fix (committed)
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Ben Elliston <bje at au1 dot ibm dot com>
- Cc: binutils at sourceware dot org, Paul Brook <paul at codesourcery dot com>
- Date: Wed, 15 Mar 2006 10:29:14 +0000
- Subject: Re: PATCH: elf32-arm.c fix (committed)
- References: <20060314235808.GA16081@ozlabs.au.ibm.com>
On Tue, 2006-03-14 at 23:58, Ben Elliston wrote:
> This patch corrects a bug where iterating over a list (in_list), we
> break after the first element, warning only if that element is
> erroneous. I suspect the correct behaviour is to examine all list
> elements, but only issue one warning.
>
> Committed as obvious; feel free to grill me if I am wrong!
>
> 2006-03-15 Ben Elliston <bje@au.ibm.com>
>
> * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all
> in_list elements, not just the first.
>
Looks sensible to me. Though I'm surprised we only want to issue one
warning. Paul, why don't we complain about all the unknown attributes?
Also, the test before the warning looks suspicious as well. Why is the
mask 128, but the comparison '< 64'. I suspect the mask should be 127
(ie modulo 128).
R.
> Index: elf32-arm.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf32-arm.c,v
> retrieving revision 1.68
> diff -u -p -r1.68 elf32-arm.c
> --- elf32-arm.c 10 Mar 2006 17:20:28 -0000 1.68
> +++ elf32-arm.c 14 Mar 2006 23:49:43 -0000
> @@ -5146,10 +5146,12 @@ elf32_arm_merge_eabi_attributes (bfd *ib
> for (; in_list; in_list = in_list->next)
> {
> if ((in_list->tag & 128) < 64)
> - _bfd_error_handler
> - (_("Warning: %B: Unknown EABI object attribute %d"),
> - ibfd, in_list->tag);
> - break;
> + {
> + _bfd_error_handler
> + (_("Warning: %B: Unknown EABI object attribute %d"),
> + ibfd, in_list->tag);
> + break;
> + }
> }
> return TRUE;
> }