From 17e57237251c3d20ba1cea0192d7dcc078ea32e2 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 23 Feb 2010 11:38:36 +0000 Subject: PR 11297: Add support for 8-bit relocations to the AVR toolchain. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-avr.c | 23 +++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'bfd') 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 + + 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 * 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 -- cgit v1.1