aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-10-16 01:42:42 +0000
committerAlan Modra <amodra@gmail.com>2012-10-16 01:42:42 +0000
commit65e911f9f068d3f171c4b5e17bdbfdc3e2a23037 (patch)
treefb9ccd6ba12de64307e5a4f9e56bd5d6b73434bc
parentf3a0ed298aa0c4e92cfc9e0dcf07bd0e6e02fdff (diff)
downloadgdb-65e911f9f068d3f171c4b5e17bdbfdc3e2a23037.zip
gdb-65e911f9f068d3f171c4b5e17bdbfdc3e2a23037.tar.gz
gdb-65e911f9f068d3f171c4b5e17bdbfdc3e2a23037.tar.bz2
* elf32-xtensa.c (free_section_cache): Renamed from
clear_section_cache. Don't zero cache. (section_cache_section): Remove ineffectual zero of cache. Call init_section_cache instead.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-xtensa.c12
2 files changed, 13 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 57c7e17..7033bac 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-16 Alan Modra <amodra@gmail.com>
+
+ * elf32-xtensa.c (free_section_cache): Renamed from
+ clear_section_cache. Don't zero cache.
+ (section_cache_section): Remove ineffectual zero of cache.
+ Call init_section_cache instead.
+
2012-10-15 Doug Evans <dje@google.com>
* elf.c (special_sections_d): Add comment.
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 797979f..4316322 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -6067,7 +6067,7 @@ init_section_cache (section_cache_t *sec_cache)
static void
-clear_section_cache (section_cache_t *sec_cache)
+free_section_cache (section_cache_t *sec_cache)
{
if (sec_cache->sec)
{
@@ -6075,7 +6075,6 @@ clear_section_cache (section_cache_t *sec_cache)
release_internal_relocs (sec_cache->sec, sec_cache->relocs);
if (sec_cache->ptbl)
free (sec_cache->ptbl);
- memset (sec_cache, 0, sizeof (sec_cache));
}
}
@@ -6116,8 +6115,8 @@ section_cache_section (section_cache_t *sec_cache,
goto err;
/* Fill in the new section cache. */
- clear_section_cache (sec_cache);
- memset (sec_cache, 0, sizeof (sec_cache));
+ free_section_cache (sec_cache);
+ init_section_cache (sec_cache);
sec_cache->sec = sec;
sec_cache->contents = contents;
@@ -8272,8 +8271,9 @@ compute_removed_literals (bfd *abfd,
#endif /* DEBUG */
error_return:
- if (prop_table) free (prop_table);
- clear_section_cache (&target_sec_cache);
+ if (prop_table)
+ free (prop_table);
+ free_section_cache (&target_sec_cache);
release_contents (sec, contents);
release_internal_relocs (sec, internal_relocs);