This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch,avr] Fix PR13899
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: binutils at sourceware dot org
- Cc: Denis Chertykov <chertykov at gmail dot com>, Eric Weddington <eric dot weddington at atmel dot com>, Jan Waclawek <konfera at efton dot sk>
- Date: Tue, 24 Jul 2012 20:46:27 +0200
- Subject: [Patch,avr] Fix PR13899
This is a repost of a patch supplied by Jan Waclawek in [1].
I don't know if Jan has a copy right assignment in file, but the
patch should be small enough to apply it without CA on file.
I removed some log lines to get the patch as small as possible, and
the patch is in a valid format now: bugzilla shreds inline patches
as it removes trailing blanks.
For the ChangeLog please use Jan Waclawek <konfera at efton dot sk>
Johann
[1]
http://sourceware.org/bugzilla/show_bug.cgi?id=13899#c4
bfd/
PR 13899
* elf32-avr.c (elf32_avr_relax_delete_bytes): Call
_bfd_elf_link_read_relocs with keep_memory as TRUE.
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 38e41df..857a4b7 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -1558,7 +1558,7 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
irel = elf_section_data (isec)->relocs;
/* PR 12161: Read in the relocs for this section if necessary. */
if (irel == NULL)
- irel = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, FALSE);
+ irel = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, TRUE);
for (irelend = irel + isec->reloc_count;
irel < irelend;
@@ -1617,9 +1617,6 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
/* else...Reference symbol is extern. No need for adjusting
the addend. */
}
-
- if (elf_section_data (isec)->relocs == NULL)
- free (irelend - isec->reloc_count);
}
}