aboutsummaryrefslogtreecommitdiff
path: root/bfd
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 /bfd
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-avr.c23
2 files changed, 25 insertions, 4 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