aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-avr.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7cf79bb..b1b053b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-30 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ * elf32-avr.c (avr_elf32_load_records_from_section): Free
+ internal_relocs only if they aren't cached.
+
2016-03-29 Nick Clifton <nickc@redhat.com>
PR 17334
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 91994f0..764d0d1 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -4068,11 +4068,13 @@ avr_elf32_load_records_from_section (bfd *abfd, asection *sec)
}
free (contents);
- free (internal_relocs);
+ if (elf_section_data (sec)->relocs != internal_relocs)
+ free (internal_relocs);
return r_list;
load_failed:
- free (internal_relocs);
+ if (elf_section_data (sec)->relocs != internal_relocs)
+ free (internal_relocs);
free (contents);
free (r_list);
return NULL;