PATCH: elf32-arm.c fix (committed)

Richard Earnshaw rearnsha@arm.com
Wed Mar 15 10:30:00 GMT 2006


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;
>  }



More information about the Binutils mailing list