This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Patch [avr]: makes avr-6 incompatible with other avr architectures
- From: Tristan Gingold <gingold at adacore dot com>
- To: binutils at sourceware dot org
- Cc: Eric Weddington <eweddington at cso dot atmel dot com>
- Date: Thu, 27 Nov 2008 16:19:00 +0100
- 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.
Tristan.
bfd:
2008-11-27 Tristan Gingold <gingold@adacore.com>
* cpu-avr.c (compatible): Makes avr-6 compatible only with itself.
*** 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)
{
/* Special case for ATmega[16]03 (avr:3) and ATmega83 (avr:
4). */