From 6aa82b649b1352d7c6c0132f2ba631f5e7bde6f3 Mon Sep 17 00:00:00 2001 From: "Eric B. Weddington" Date: Tue, 24 Jul 2012 21:44:44 +0000 Subject: [PATCH] 2012-07-24 Jan Waclawek PR 13899 * elf32-avr.c (elf32_avr_relax_delete_bytes): Call _bfd_elf_link_read_relocs with keep_memory as TRUE. --- bfd/ChangeLog | 5 +++++ bfd/elf32-avr.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b958889421..3ed8a8439a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2012-07-24 Jan Waclawek + PR 13899 + * elf32-avr.c (elf32_avr_relax_delete_bytes): Call + _bfd_elf_link_read_relocs with keep_memory as TRUE. + 2012-07-24 Teresa Johnson * bfd.c (bfd_find_nearest_line_discriminator): New macro. diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index 38e41df48d..857a4b7f41 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); } } -- 2.34.1