aboutsummaryrefslogtreecommitdiff
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
parent1c063135aa615963302a84f89a09ee3494081a70 (diff)
downloadgdb-17e57237251c3d20ba1cea0192d7dcc078ea32e2.zip
gdb-17e57237251c3d20ba1cea0192d7dcc078ea32e2.tar.gz
gdb-17e57237251c3d20ba1cea0192d7dcc078ea32e2.tar.bz2
PR 11297: Add support for 8-bit relocations to the AVR toolchain.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-avr.c23
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-avr.c15
-rw-r--r--include/elf/ChangeLog19
-rw-r--r--include/elf/avr.h3
6 files changed, 57 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c56c3d5..1ecd034 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-23 Andrew Zabolotny <anpaza@mail.ru>
+
+ PR binutils/11297
+ * elf32-avr.c (elf_avr_howto_table): Add R_AVR_8.
+ (avr_reloc_map): Map BFD_RELOC_8 to R_AVR_8.
+
2010-02-22 Alan Modra <amodra@gmail.com>
* reloc.c (bfd_check_overflow): When forming addrmask, shift
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 0b85105..92c5be9 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -473,7 +473,7 @@ static reloc_howto_type elf_avr_howto_table[] =
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A low 8 bit absolute relocation of 24 bit program memory address.
- For LDI command. Will be changed when linker stubs are needed. */
+ For LDI command. Will be changed when linker stubs are needed. */
HOWTO (R_AVR_LO8_LDI_GS, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -488,7 +488,7 @@ static reloc_howto_type elf_avr_howto_table[] =
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A low 8 bit absolute relocation of 24 bit program memory address.
- For LDI command. Will be changed when linker stubs are needed. */
+ For LDI command. Will be changed when linker stubs are needed. */
HOWTO (R_AVR_HI8_LDI_GS, /* type */
9, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -501,7 +501,21 @@ static reloc_howto_type elf_avr_howto_table[] =
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE) /* pcrel_offset */
+ FALSE), /* pcrel_offset */
+ /* 8 bit offset. */
+ HOWTO (R_AVR_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_AVR_8", /* name */
+ FALSE, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
/* Map BFD reloc types to AVR ELF reloc types. */
@@ -539,7 +553,8 @@ static const struct avr_reloc_map avr_reloc_map[] =
{ BFD_RELOC_AVR_CALL, R_AVR_CALL },
{ BFD_RELOC_AVR_LDI, R_AVR_LDI },
{ BFD_RELOC_AVR_6, R_AVR_6 },
- { BFD_RELOC_AVR_6_ADIW, R_AVR_6_ADIW }
+ { BFD_RELOC_AVR_6_ADIW, R_AVR_6_ADIW },
+ { BFD_RELOC_8, R_AVR_8 }
};
/* Meant to be filled one day with the wrap around address for the
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);
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 52e4c37..349ee19 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-23 Andrew Zabolotny <anpaza@mail.ru>
+
+ PR binutils/11297
+ * avr.h: (R_AVR_8): New relocation number.
+
2010-02-18 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* arm.h (Tag_MPextension_use): Renumber.
@@ -14,7 +19,7 @@
* common.h (NT_386_XSTATE): New.
2010-01-21 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
-
+
* s390.h (EF_S390_HIGH_GPRS): Added macro definition.
2010-01-19 Daisuke Hatayama <d.hatayama@jp.fujitsu.com>
@@ -78,11 +83,11 @@
R_push, R_const, R_add, R_sub, R_mult, R_div, R_mod, R_lshift,
R_rshift, R_and, R_or, R_xor, R_land, R_lor, R_len, R_neg, R_comp,
R_page, R_hwpage, R_addr, R_pltpc, R_got.
-
+
2009-08-09 Michael Eager <eager@eagercon.com>
* elf/common.h: Define EM_resnnn reserved values. Add EM_AVR32,
- EM_STM8, EM_TILE64, EM_TILEPRO. Change EM_MICROBLAZE.
+ EM_STM8, EM_TILE64, EM_TILEPRO. Change EM_MICROBLAZE.
2009-08-06 Michael Eager <eager@eagercon.com>
@@ -188,8 +193,8 @@
2009-03-14 Mark Kettenis <kettenis@gnu.org>
- * common.h (NT_OPENBSD_PROCINFO, NT_OPENBSD_AUXV)
- (NT_OPENBSD_REGS, NT_OPENBSD_FPREGS, NT_OPENBSD_XFPREGS)
+ * common.h (NT_OPENBSD_PROCINFO, NT_OPENBSD_AUXV)
+ (NT_OPENBSD_REGS, NT_OPENBSD_FPREGS, NT_OPENBSD_XFPREGS)
(NT_OPENBSD_WCOOKIE): New defines.
2009-03-16 Jan Kratochvil <jan.kratochvil@redhat.com>
@@ -272,7 +277,7 @@
2008-11-14 Nathan Sidwell <nathan@codesourcery.com>
* internal.h (struct elf_segment_map): Add header_size field.
-
+
2008-10-13 Ulrich Weigand <uweigand@de.ibm.com>
* common.h (AT_BASE_PLATFORM, AT_EXECFN): Define.
@@ -346,7 +351,7 @@
END_RELOC_NUMBERS symbol as a sentinel value.
2008-05-15 Christophe Lyon <christophe.lyon@st.com>
-
+
* arm.h (END_RELOC_NUMBERS): Provide a maximum value.
2008-04-16 David S. Miller <davem@davemloft.net>
diff --git a/include/elf/avr.h b/include/elf/avr.h
index 627dc35..373448c 100644
--- a/include/elf/avr.h
+++ b/include/elf/avr.h
@@ -1,5 +1,5 @@
/* AVR ELF support for BFD.
- Copyright 1999, 2000, 2004, 2006 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2004, 2006, 2010 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library.
@@ -69,6 +69,7 @@ START_RELOC_NUMBERS (elf_avr_reloc_type)
RELOC_NUMBER (R_AVR_MS8_LDI_NEG, 23)
RELOC_NUMBER (R_AVR_LO8_LDI_GS, 24)
RELOC_NUMBER (R_AVR_HI8_LDI_GS, 25)
+ RELOC_NUMBER (R_AVR_8, 26)
END_RELOC_NUMBERS (R_AVR_max)
#endif /* _ELF_AVR_H */