mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
PR 11297: Add support for 8-bit relocations to the AVR toolchain.
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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 */
|
||||
|
Reference in New Issue
Block a user