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: "Denis Chertykov" <chertykov at gmail dot com>
- To: "Weddington, Eric" <eweddington at cso dot atmel dot com>
- Cc: "Tristan Gingold" <gingold at adacore dot com>, binutils at sourceware dot org, "Anatoliy Sokolov" <aesok at post dot ru>
- Date: Mon, 8 Dec 2008 11:53:21 +0300
- Subject: Re: Patch [avr]: makes avr-6 incompatible with other avr architectures
- References: <8840DAA1-9BCE-4D53-B0CF-18E6A6C7E941@adacore.com> <258DDD1F44B6ED4AAFD4370847CF58D50408902D@csomb01.corp.atmel.com>
2008/12/4 Weddington, Eric <eweddington@cso.atmel.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?
Approved.
Denis.