This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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>



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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]