aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-02-23 11:38:36 +0000
committerNick Clifton <nickc@redhat.com>2010-02-23 11:38:36 +0000
commit17e57237251c3d20ba1cea0192d7dcc078ea32e2 (patch)
tree946069cb7262bb2e76c561d790a7fcff552aec72 /gas
parent1c063135aa615963302a84f89a09ee3494081a70 (diff)
downloadfsf-binutils-gdb-17e57237251c3d20ba1cea0192d7dcc078ea32e2.zip
fsf-binutils-gdb-17e57237251c3d20ba1cea0192d7dcc078ea32e2.tar.gz
fsf-binutils-gdb-17e57237251c3d20ba1cea0192d7dcc078ea32e2.tar.bz2
PR 11297: Add support for 8-bit relocations to the AVR toolchain.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-avr.c15
2 files changed, 18 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index bd4acd5..a2807f6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-23 Andrew Zabolotny <anpaza@mail.ru>
+
+ PR binutils/11297
+ * config/tc-avr.c (md_apply_fix): Handle BFD_RELOC_8.
+ (avr_cons_fix_new): Handle fixups of a single byte.
+
2010-02-22 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
PR 9861
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index 9d14f64..a884068 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -1,7 +1,7 @@
/* tc-avr.c -- Assembler code for the ATMEL AVR
- Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of GAS, the GNU Assembler.
@@ -1153,6 +1153,13 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
bfd_putl16 ((bfd_vma) value, where);
break;
+ case BFD_RELOC_8:
+ if (value > 255 || value < -128)
+ as_warn_where (fixP->fx_file, fixP->fx_line,
+ _("operand out of range: %ld"), value);
+ *where = value;
+ break;
+
case BFD_RELOC_AVR_16_PM:
bfd_putl16 ((bfd_vma) (value >> 1), where);
break;
@@ -1442,7 +1449,9 @@ avr_cons_fix_new (fragS *frag,
{
if (exp_mod_pm == 0)
{
- if (nbytes == 2)
+ if (nbytes == 1)
+ fix_new_exp (frag, where, nbytes, exp, FALSE, BFD_RELOC_8);
+ else if (nbytes == 2)
fix_new_exp (frag, where, nbytes, exp, FALSE, BFD_RELOC_16);
else if (nbytes == 4)
fix_new_exp (frag, where, nbytes, exp, FALSE, BFD_RELOC_32);