This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: Patch [avr]: makes avr-6 incompatible with other avr architectures
- From: "Weddington, Eric" <eweddington at cso dot atmel dot com>
- To: "Tristan Gingold" <gingold at adacore dot com>, <binutils at sourceware dot org>, "Denis Chertykov" <chertykov at gmail dot com>
- Cc: "Anatoliy Sokolov" <aesok at post dot ru>
- Date: Thu, 4 Dec 2008 11:22:58 -0700
- Subject: RE: Patch [avr]: makes avr-6 incompatible with other avr architectures
- References: <8840DAA1-9BCE-4D53-B0CF-18E6A6C7E941@adacore.com>
> -----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