aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-10-16 01:42:41 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-10-16 01:42:41 +0000
commit3cacf06a9304ac922b47098373c10d97c933d020 (patch)
tree73fb8834cef827eccface16db0f71c0efc063058
parent6a224bfecb05c4a7b6125f11e0487ef1e5b2310a (diff)
downloadbinutils-3cacf06a9304ac922b47098373c10d97c933d020.tar.gz
* 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 57c7e173b..7033bac85 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 797979f11..43163226f 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);