From 328e7bfdde7267f5e4b971bc6dca7b82aef77661 Mon Sep 17 00:00:00 2001
From: Denis Chertykov <chertykov@gmail.com>
Date: Wed, 8 Jul 2015 21:35:19 +0300
Subject: 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.
---
 include/elf/avr.h | 1 +
 1 file changed, 1 insertion(+)

(limited to 'include/elf/avr.h')

diff --git a/include/elf/avr.h b/include/elf/avr.h
index 115296d..f0ef479 100644
--- a/include/elf/avr.h
+++ b/include/elf/avr.h
@@ -87,6 +87,7 @@ START_RELOC_NUMBERS (elf_avr_reloc_type)
      RELOC_NUMBER (R_AVR_LDS_STS_16,           33)
      RELOC_NUMBER (R_AVR_PORT6,                34)
      RELOC_NUMBER (R_AVR_PORT5,                35)
+     RELOC_NUMBER (R_AVR_32_PCREL,             36)
 END_RELOC_NUMBERS (R_AVR_max)
 
 #endif /* _ELF_AVR_H */
-- 
cgit v1.1