* elf32-xtensa.c (free_section_cache): Renamed from
authorAlan Modra <amodra@gmail.com>
Tue, 16 Oct 2012 01:42:42 +0000 (01:42 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 16 Oct 2012 01:42:42 +0000 (01:42 +0000)
clear_section_cache.  Don't zero cache.
(section_cache_section): Remove ineffectual zero of cache.
Call init_section_cache instead.

bfd/ChangeLog
bfd/elf32-xtensa.c

index 57c7e173bc4a156d6401727b40f8e6295b1ff9cf..7033bac8560fa43c64b654bf41e826aeca5f7c07 100644 (file)
@@ -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.
index 797979f11a92b8c32608d7eebf399e45f806ab1e..43163226f8848ac484c88440307d6aaa2823e151 100644 (file)
@@ -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);
This page took 0.030939 seconds and 4 git commands to generate.