This fails on binutils-2_26 branch. The fix to PR 20221 does not fix this. $ cat test.s .text .global _start, dest _start: jmp dest .align 1 dest: nop rjmp dest With $ avr-gcc -mmcu=atmega1280 -Os -mrelax test.s -nostartfiles $ avr-objdump -S a.out 00000000 <__ctors_end>: 0: 00 c0 rjmp .+0 ; 0x2 <dest> 00000002 <dest>: 2: 00 00 nop 4: 00 c0 rjmp .+0 ; 0x6 <_etext> The rjmp at address 4 jumps to 0x6, instead of 0x2 (which is where dest is).
The master branch has been updated by Senthil Kumar Selvaraj <saaadhu@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31eef93e717c59975b3e6f37619ab956302ca37a commit 31eef93e717c59975b3e6f37619ab956302ca37a Author: Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> Date: Wed Jun 15 12:25:30 2016 +0530 Fix PR ld/20254 This patch fixes another edge case related to alignment property records - reloc offsets adjacent to property record offsets were not getting adjusted during relaxation. bfd/ PR ld/20254 * elf32-avr.c (elf32_avr_relax_delete_bytes): Adjust reloc offsets until reloc_toaddr. ld/ PR ld/20254 * testsuite/ld-avr/avr-prop-6.d: New test. * testsuite/ld-avr/avr-prop-6.s: New test.
The binutils-2_26-branch branch has been updated by Senthil Kumar Selvaraj <saaadhu@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=30d923a46a5b6536a2a670be3b4c8209745b308d commit 30d923a46a5b6536a2a670be3b4c8209745b308d Author: Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> Date: Wed Jun 15 12:25:30 2016 +0530 Fix PR ld/20254 This patch fixes another edge case related to alignment property records - reloc offsets adjacent to property record offsets were not getting adjusted during relaxation. bfd/ PR ld/20254 * elf32-avr.c (elf32_avr_relax_delete_bytes): Adjust reloc offsets until reloc_toaddr. ld/ PR ld/20254 * testsuite/ld-avr/avr-prop-6.d: New test. * testsuite/ld-avr/avr-prop-6.s: New test.
Fixed in trunk and backported to 2.26 a while back.