From 65e911f9f068d3f171c4b5e17bdbfdc3e2a23037 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 16 Oct 2012 01:42:42 +0000 Subject: [PATCH] * 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. --- bfd/ChangeLog | 7 +++++++ bfd/elf32-xtensa.c | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 57c7e173bc4..7033bac8560 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2012-10-16 Alan Modra + + * 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 * elf.c (special_sections_d): Add comment. diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 797979f11a9..43163226f88 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); -- 2.30.2