+2013-03-01 Mark Wielaard <mjw@redhat.com>
+
+ * findtextrel.c (process_file): Release ELF and close file when not
+ text relocations are found.
+ * strip.c (handle_elf): Track memory used for .debuglink section data
+ and free when done.
+
2013-02-24 Mark Wielaard <mjw@redhat.com>
* elflint.c (check_symtab): Add __bss_start__ to the list of symbols
Elf_Data debuglink_crc_data;
bool any_symtab_changes = false;
Elf_Data *shstrtab_data = NULL;
+ void *debuglink_buf = NULL;
/* Create the full name of the file. */
if (prefix != NULL)
shdr_info[cnt].data->d_align = 4;
shdr_info[cnt].shdr.sh_size = shdr_info[cnt].data->d_size
= crc_offset + 4;
- shdr_info[cnt].data->d_buf = xcalloc (1, shdr_info[cnt].data->d_size);
+ debuglink_buf = xcalloc (1, shdr_info[cnt].data->d_size);
+ shdr_info[cnt].data->d_buf = debuglink_buf;
strcpy (shdr_info[cnt].data->d_buf, debug_basename);
free (shdr_info[cnt].debug_data->d_buf);
}
+ /* Free data we allocated for the .gnu_debuglink section. */
+ free (debuglink_buf);
+
/* Free the memory. */
if ((shnum + 2) * sizeof (struct shdr_info) > MAX_STACK_ALLOC)
free (shdr_info);