aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/config/tc-avr.c206
-rw-r--r--gas/config/tc-avr.h29
-rw-r--r--gas/doc/as.texinfo10
4 files changed, 145 insertions, 104 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a709d18..cb9fa62 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,7 @@
+2006-05-24 Bjoern Haase <bjoern.m.haase@web.de>
+
+ * config/tc-avr.c: Add new cpu targets avr6, avr2560 and avr2561.
+
2006-05-23 Thiemo Seufer <ths@mips.com>
David Ung <davidu@mips.com>
Nigel Stephens <nigel@mips.com>
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index 7a95033..cd1e47e 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -63,89 +63,92 @@ struct mcu_type_s
static struct mcu_type_s mcu_types[] =
{
- {"avr1", AVR_ISA_TINY1, bfd_mach_avr1},
- {"avr2", AVR_ISA_TINY2, bfd_mach_avr2},
- {"avr3", AVR_ISA_M103, bfd_mach_avr3},
- {"avr4", AVR_ISA_M8, bfd_mach_avr4},
- {"avr5", AVR_ISA_ALL, bfd_mach_avr5},
- {"at90s1200", AVR_ISA_1200, bfd_mach_avr1},
- {"attiny10", AVR_ISA_TINY1, bfd_mach_avr1}, /* XXX -> tn11 */
- {"attiny11", AVR_ISA_TINY1, bfd_mach_avr1},
- {"attiny12", AVR_ISA_TINY1, bfd_mach_avr1},
- {"attiny15", AVR_ISA_TINY1, bfd_mach_avr1},
- {"attiny28", AVR_ISA_TINY1, bfd_mach_avr1},
- {"at90s2313", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at90s2323", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at90s2333", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 4433 */
- {"at90s2343", AVR_ISA_2xxx, bfd_mach_avr2},
- {"attiny22", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 2343 */
- {"attiny26", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at90s4433", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at90s4414", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8515 */
- {"at90s4434", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8535 */
- {"at90s8515", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at90s8535", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at90c8534", AVR_ISA_2xxx, bfd_mach_avr2},
- {"at86rf401", AVR_ISA_2xxx, bfd_mach_avr2},
- {"attiny13", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny2313",AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny261", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny461", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny861", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny24", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny44", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny84", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny25", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny45", AVR_ISA_TINY2, bfd_mach_avr2},
- {"attiny85", AVR_ISA_TINY2, bfd_mach_avr2},
- {"atmega603", AVR_ISA_M603, bfd_mach_avr3}, /* XXX -> m103 */
- {"atmega103", AVR_ISA_M103, bfd_mach_avr3},
- {"at43usb320",AVR_ISA_M103, bfd_mach_avr3},
- {"at43usb355",AVR_ISA_M603, bfd_mach_avr3},
- {"at76c711", AVR_ISA_M603, bfd_mach_avr3},
- {"atmega48", AVR_ISA_PWMx, bfd_mach_avr4},
- {"atmega8", AVR_ISA_M8, bfd_mach_avr4},
- {"atmega83", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8535 */
- {"atmega85", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8 */
- {"atmega88", AVR_ISA_PWMx, bfd_mach_avr4},
- {"atmega8515",AVR_ISA_M8, bfd_mach_avr4},
- {"atmega8535",AVR_ISA_M8, bfd_mach_avr4},
- {"at90pwm2", AVR_ISA_PWMx, bfd_mach_avr4},
- {"at90pwm3", AVR_ISA_PWMx, bfd_mach_avr4},
- {"atmega16", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega161", AVR_ISA_M161, bfd_mach_avr5},
- {"atmega162", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega163", AVR_ISA_M161, bfd_mach_avr5},
- {"atmega164", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega165", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega168", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega169", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega32", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega323", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega324", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega325", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega329", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega3250",AVR_ISA_M323, bfd_mach_avr5},
- {"atmega3290",AVR_ISA_M323, bfd_mach_avr5},
- {"atmega406", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega64", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega640", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega644", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega128", AVR_ISA_M128, bfd_mach_avr5},
- {"atmega1280",AVR_ISA_M128, bfd_mach_avr5},
- {"atmega1281",AVR_ISA_M128, bfd_mach_avr5},
- {"atmega645", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega649", AVR_ISA_M323, bfd_mach_avr5},
- {"atmega6450",AVR_ISA_M323, bfd_mach_avr5},
- {"atmega6490",AVR_ISA_M323, bfd_mach_avr5},
- {"at90can32" ,AVR_ISA_M323, bfd_mach_avr5},
- {"at90can64" ,AVR_ISA_M323, bfd_mach_avr5},
- {"at90can128",AVR_ISA_M128, bfd_mach_avr5},
+ {"avr1", AVR_ISA_TINY1, bfd_mach_avr1},
+ {"avr2", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"avr3", AVR_ISA_M103, bfd_mach_avr3},
+ {"avr4", AVR_ISA_M8, bfd_mach_avr4},
+ {"avr5", AVR_ISA_ALL, bfd_mach_avr5},
+ {"avr6", AVR_ISA_ALL, bfd_mach_avr6},
+ {"at90s1200", AVR_ISA_1200, bfd_mach_avr1},
+ {"attiny10", AVR_ISA_TINY1, bfd_mach_avr1}, /* XXX -> tn11 */
+ {"attiny11", AVR_ISA_TINY1, bfd_mach_avr1},
+ {"attiny12", AVR_ISA_TINY1, bfd_mach_avr1},
+ {"attiny15", AVR_ISA_TINY1, bfd_mach_avr1},
+ {"attiny28", AVR_ISA_TINY1, bfd_mach_avr1},
+ {"at90s2313", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90s2323", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90s2333", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 4433 */
+ {"at90s2343", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"attiny22", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 2343 */
+ {"attiny26", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90s4433", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90s4414", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8515 */
+ {"at90s4434", AVR_ISA_2xxx, bfd_mach_avr2}, /* XXX -> 8535 */
+ {"at90s8515", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90s8535", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at90c8534", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"at86rf401", AVR_ISA_2xxx, bfd_mach_avr2},
+ {"attiny13", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny2313", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny261", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny461", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny861", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny24", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny44", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny84", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny25", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny45", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"attiny85", AVR_ISA_TINY2, bfd_mach_avr2},
+ {"atmega603", AVR_ISA_M603, bfd_mach_avr3}, /* XXX -> m103 */
+ {"atmega103", AVR_ISA_M103, bfd_mach_avr3},
+ {"at43usb320", AVR_ISA_M103, bfd_mach_avr3},
+ {"at43usb355", AVR_ISA_M603, bfd_mach_avr3},
+ {"at76c711", AVR_ISA_M603, bfd_mach_avr3},
+ {"atmega48", AVR_ISA_PWMx, bfd_mach_avr4},
+ {"atmega8", AVR_ISA_M8, bfd_mach_avr4},
+ {"atmega83", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8535 */
+ {"atmega85", AVR_ISA_M8, bfd_mach_avr4}, /* XXX -> m8 */
+ {"atmega88", AVR_ISA_PWMx, bfd_mach_avr4},
+ {"atmega8515", AVR_ISA_M8, bfd_mach_avr4},
+ {"atmega8535", AVR_ISA_M8, bfd_mach_avr4},
+ {"at90pwm2", AVR_ISA_PWMx, bfd_mach_avr4},
+ {"at90pwm3", AVR_ISA_PWMx, bfd_mach_avr4},
+ {"atmega16", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega161", AVR_ISA_M161, bfd_mach_avr5},
+ {"atmega162", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega163", AVR_ISA_M161, bfd_mach_avr5},
+ {"atmega164", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega165", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega168", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega169", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega32", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega323", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega324", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega325", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega329", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega3250", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega3290", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega406", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega64", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega640", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega644", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega128", AVR_ISA_M128, bfd_mach_avr5},
+ {"atmega1280", AVR_ISA_M128, bfd_mach_avr5},
+ {"atmega1281", AVR_ISA_M128, bfd_mach_avr5},
+ {"atmega645", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega649", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega6450", AVR_ISA_M323, bfd_mach_avr5},
+ {"atmega6490", AVR_ISA_M323, bfd_mach_avr5},
+ {"at90can32" , AVR_ISA_M323, bfd_mach_avr5},
+ {"at90can64" , AVR_ISA_M323, bfd_mach_avr5},
+ {"at90can128", AVR_ISA_M128, bfd_mach_avr5},
{"at90usb646", AVR_ISA_M323, bfd_mach_avr5},
{"at90usb647", AVR_ISA_M323, bfd_mach_avr5},
{"at90usb1286",AVR_ISA_M128, bfd_mach_avr5},
{"at90usb1287",AVR_ISA_M128, bfd_mach_avr5},
- {"at94k", AVR_ISA_94K, bfd_mach_avr5},
+ {"at94k", AVR_ISA_94K, bfd_mach_avr5},
+ {"atmega2560", AVR_ISA_ALL, bfd_mach_avr6},
+ {"atmega2561", AVR_ISA_ALL, bfd_mach_avr6},
{NULL, 0, 0}
};
@@ -512,7 +515,7 @@ avr_offset_expression (expressionS *exp)
if (exp->X_op == O_constant)
{
int x = exp->X_add_number;
-
+
if (x < -255 || x > 255)
as_warn (_("constant out of 8-bit range: %d"), x);
}
@@ -544,6 +547,8 @@ avr_ldi_expression (expressionS *exp)
char *tmp;
char op[8];
int mod;
+ int linker_stubs_should_be_generated = 0;
+
tmp = str;
str = extract_word (str, op, sizeof (op));
@@ -551,7 +556,7 @@ avr_ldi_expression (expressionS *exp)
if (op[0])
{
mod_index m;
-
+
m.ptr = hash_find (avr_mod_hash, op);
mod = m.index;
@@ -564,11 +569,14 @@ avr_ldi_expression (expressionS *exp)
if (*str == '(')
{
+ bfd_reloc_code_real_type reloc_to_return;
int neg_p = 0;
++str;
if (strncmp ("pm(", str, 3) == 0
+ || strncmp ("gs(",str,3) == 0
+ || strncmp ("-(gs(",str,5) == 0
|| strncmp ("-(pm(", str, 5) == 0)
{
if (HAVE_PM_P (mod))
@@ -579,6 +587,9 @@ avr_ldi_expression (expressionS *exp)
else
as_bad (_("illegal expression"));
+ if (str[0] == 'g' || str[2] == 'g')
+ linker_stubs_should_be_generated = 1;
+
if (*str == '-')
{
neg_p = 1;
@@ -610,7 +621,24 @@ avr_ldi_expression (expressionS *exp)
}
while (closes--);
- return neg_p ? EXP_MOD_NEG_RELOC (mod) : EXP_MOD_RELOC (mod);
+ reloc_to_return =
+ neg_p ? EXP_MOD_NEG_RELOC (mod) : EXP_MOD_RELOC (mod);
+ if (linker_stubs_should_be_generated)
+ {
+ switch (reloc_to_return)
+ {
+ case BFD_RELOC_AVR_LO8_LDI_PM:
+ reloc_to_return = BFD_RELOC_AVR_LO8_LDI_GS;
+ break;
+ case BFD_RELOC_AVR_HI8_LDI_PM:
+ reloc_to_return = BFD_RELOC_AVR_HI8_LDI_GS;
+ break;
+
+ default:
+ as_warn (_("expression dangerous with linker stubs"));
+ }
+ }
+ return reloc_to_return;
}
}
}
@@ -1227,7 +1255,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED,
return NULL;
}
- /* We are dealing with two symbols defined in the same section.
+ /* We are dealing with two symbols defined in the same section.
Let us fix-up them here. */
value += S_GET_VALUE (fixp->fx_addsy);
value -= S_GET_VALUE (fixp->fx_subsy);
@@ -1310,7 +1338,8 @@ md_assemble (char *str)
static int exp_mod_pm = 0;
/* Parse special CONS expression: pm (expression)
- which is used for addressing to a program memory.
+ or alternatively: gs (expression).
+ These are used for addressing program memory.
Relocation: BFD_RELOC_AVR_16_PM. */
void
@@ -1324,10 +1353,13 @@ avr_parse_cons_expression (expressionS *exp, int nbytes)
if (nbytes == 2)
{
- char *pm_name = "pm";
- int len = strlen (pm_name);
+ char *pm_name1 = "pm";
+ char *pm_name2 = "gs";
+ int len = strlen (pm_name1);
+ /* len must be the same for both pm identifiers. */
- if (strncasecmp (input_line_pointer, pm_name, len) == 0)
+ if (strncasecmp (input_line_pointer, pm_name1, len) == 0
+ || strncasecmp (input_line_pointer, pm_name2, len) == 0)
{
input_line_pointer = skip_space (input_line_pointer + len);
diff --git a/gas/config/tc-avr.h b/gas/config/tc-avr.h
index b79fc05..0723519 100644
--- a/gas/config/tc-avr.h
+++ b/gas/config/tc-avr.h
@@ -125,16 +125,21 @@ extern long md_pcrel_from_section (struct fix *, segT);
We will need them in case that we want to do linker relaxation.
We could in principle keep these fixups in gas when not relaxing.
However, there is no serious performance penilty when making the linker
- make the fixup work. */
-#define TC_VALIDATE_FIX(FIXP,SEG,SKIP) \
- if ( (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL \
- || FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL \
- || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM \
- || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM \
- || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM \
- || FIXP->fx_r_type == BFD_RELOC_AVR_16_PM) \
- && (FIXP->fx_addsy)) \
- { \
- goto SKIP; \
+ make the fixup work. Check also that fx_addsy is not NULL, in order to make
+ sure that the fixup refers to some sort of lable. */
+#define TC_VALIDATE_FIX(FIXP,SEG,SKIP) \
+ if ( (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_GS \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_GS \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM_NEG \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM_NEG \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM_NEG \
+ || FIXP->fx_r_type == BFD_RELOC_AVR_16_PM) \
+ && (FIXP->fx_addsy)) \
+ { \
+ goto SKIP; \
}
-
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index c1a48ff..18e2417 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -1,6 +1,6 @@
\input texinfo @c -*-Texinfo-*-
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c 2001, 2002, 2003, 2004, 2005
+@c 2001, 2002, 2003, 2004, 2005, 2006
@c Free Software Foundation, Inc.
@c UPDATE!! On future updates--
@c (1) check for new machine-dep cmdline options in
@@ -100,7 +100,7 @@ END-INFO-DIR-ENTRY
This file documents the GNU Assembler "@value{AS}".
@c man begin COPYRIGHT
-Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
@@ -153,7 +153,7 @@ done.
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
@@ -191,7 +191,7 @@ section entitled ``GNU Free Documentation License''.
* Reporting Bugs:: Reporting Bugs
* Acknowledgements:: Who Did What
* GNU Free Documentation License:: GNU Free Documentation License
-* AS Index:: AS Index
+* AS Index:: AS Index
@end menu
@end ifnottex
@@ -5971,7 +5971,7 @@ For ELF targets, the @code{.type} directive is used like this:
This sets the type of symbol @var{name} to be either a
function symbol or an object symbol. There are five different syntaxes
supported for the @var{type description} field, in order to provide
-compatibility with various other assemblers.
+compatibility with various other assemblers.
Because some of the characters used in these syntaxes (such as @samp{@@} and
@samp{#}) are comment characters for some architectures, some of the syntaxes