diff options
author | Denis Chertykov <chertykov@gmail.com> | 2015-07-08 21:35:19 +0300 |
---|---|---|
committer | Denis Chertykov <chertykov@gmail.com> | 2015-07-08 21:41:52 +0300 |
commit | 328e7bfdde7267f5e4b971bc6dca7b82aef77661 (patch) | |
tree | 55de9e4f72b35c5e1bbbec78e50812e47198ae8c /bfd | |
parent | 7c7f93f6e5ce31223acbe871fe0c7e4daf0d8bbc (diff) | |
download | gdb-328e7bfdde7267f5e4b971bc6dca7b82aef77661.zip gdb-328e7bfdde7267f5e4b971bc6dca7b82aef77661.tar.gz gdb-328e7bfdde7267f5e4b971bc6dca7b82aef77661.tar.bz2 |
Define DIFF_EXPR_OK for avr target to allow PC relative difference relocation.
When generating relocation (tc_gen_reloc) 32 bit relocation fixup
is changed to new 32 bit PC relative relocation if the fixup has pc-relative
flag set.
bfd/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* elf32-avr.c: Add 32 bit PC relative relocation for AVR target.
gas/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* config/tc-avr.c (tc_gen_reloc): Change 32 bit relocation to
32 bit PC relative and update offset if the fixup is pc-relative.
* config/tc-avr.h (DIFF_EXPR_OK): Define to enable PC relative diff
relocs.
gas/testsuite/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* gas/avr/pc-relative-reloc.d: New test for 32 bit pc relative reloc.
* gas/avr/per-function-debugline.s: New test source.
include/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* elf/avr.h: Add new 32 bit PC relative relocation.
ld/testsuite/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* ld-avr/gc-section-debugline.d: New test.
* ld-avr/per-function-debugline.s: Source for new test.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/elf32-avr.c | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 97d3ea3..e6d1783 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2015-07-08 Pitchumani Sivanupandi <pitchumani.s@atmel.com> + + * elf32-avr.c: Add 32 bit PC relative relocation for AVR target. + 2015-07-05 Richard Sandiford <richard.sandiford@arm.com> * elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index 8651f49..bd57ab7 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -641,7 +641,22 @@ static reloc_howto_type elf_avr_howto_table[] = FALSE, /* partial_inplace */ 0xffffff, /* src_mask */ 0xffffff, /* dst_mask */ - FALSE) /* pcrel_offset */ + FALSE), /* pcrel_offset */ + + /* A 32 bit PC relative relocation. */ + HOWTO (R_AVR_32_PCREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AVR_32_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ }; /* Map BFD reloc types to AVR ELF reloc types. */ @@ -689,7 +704,8 @@ static const struct avr_reloc_map avr_reloc_map[] = { BFD_RELOC_AVR_DIFF32, R_AVR_DIFF32 }, { BFD_RELOC_AVR_LDS_STS_16, R_AVR_LDS_STS_16}, { BFD_RELOC_AVR_PORT6, R_AVR_PORT6}, - { BFD_RELOC_AVR_PORT5, R_AVR_PORT5} + { BFD_RELOC_AVR_PORT5, R_AVR_PORT5}, + { BFD_RELOC_32_PCREL, R_AVR_32_PCREL} }; /* Meant to be filled one day with the wrap around address for the |