This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Patch [avr]: makes avr-6 incompatible with other avr architectures


> -----Original Message-----
> From: Tristan Gingold [mailto:gingold@adacore.com] 
> Sent: Thursday, November 27, 2008 8:19 AM
> To: binutils@sourceware.org
> Cc: Weddington, Eric
> Subject: Patch [avr]: makes avr-6 incompatible with other avr 
> architectures
> 
> Hi,
> 
> the avr6 MCUs save the return address on 3 bytes (instead of 2 for  
> other archs).  As a consequence, the
> call convention is slightly different (the offset of the first  
> argument saved on the stack differs).
> To avoid inconsistencies, this patch makes ld refuse to link avr6  
> objects with other arch objects.
> 
> 
> *** cpu-avr.c	9 Aug 2008 05:35:12 -0000	1.13
> --- cpu-avr.c	27 Nov 2008 15:16:26 -0000
> ***************
> *** 38,43 ****
> --- 38,49 ----
>      if (a->mach == b->mach)
>        return a;
> 
> +   /* avr-6 is compatible only with itself as its call 
> convention is  
> not
> +      compatible with other avr (the mcu saves the return 
> address on  
> 3 bytes
> +      instead of 2).  */
> +   if (a->mach == bfd_mach_avr6 || b->mach == bfd_mach_avr6)
> +     return NULL;
> +
>      if (a->mach <= bfd_mach_avr6 && b->mach <= bfd_mach_avr6)

Hi Tristan,

If you are checking if the machine is equal to bfd_mach_avr6 earlier, then we should also change the <= operators in the line above to be only <. Like so:

      if (a->mach < bfd_mach_avr6 && b->mach < bfd_mach_avr6)

Denis, can you approve the patch with change mentioned?

I am not an official avr port maintainer. (yet)

Eric


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]