1 Upstream-Status: Backport
4 * (free_section_cache): Renamed from clear_section_cache.
5 * (section_cache_section): Remove ineffectual zero of cache.
6 Call init_section_cache instead.
8 binutils build might fail on recent Linux distros:
9 binutils-2.23.1/bfd/elf32-xtensa.c:6078:36: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
10 memset (sec_cache, 0, sizeof (sec_cache));
12 binutils-2.23.1/bfd/elf32-xtensa.c:6120:32: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
13 memset (sec_cache, 0, sizeof (sec_cache));
15 The original commit is http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-xtensa.c.diff?r1=1.135&r2=1.136&cvsroot=src
17 Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
19 --- binutils-2.23.1/bfd/elf32-xtensa.c.org 2013-03-12 03:04:29.000000000 -0500
20 +++ binutils-2.23.1/bfd/elf32-xtensa.c 2013-03-12 03:06:37.000000000 -0500
25 -clear_section_cache (section_cache_t *sec_cache)
26 +free_section_cache (section_cache_t *sec_cache)
31 release_internal_relocs (sec_cache->sec, sec_cache->relocs);
33 free (sec_cache->ptbl);
34 - memset (sec_cache, 0, sizeof (sec_cache));
41 /* Fill in the new section cache. */
42 - clear_section_cache (sec_cache);
43 - memset (sec_cache, 0, sizeof (sec_cache));
44 + free_section_cache (sec_cache);
45 + init_section_cache (sec_cache);
48 sec_cache->contents = contents;
53 - if (prop_table) free (prop_table);
54 - clear_section_cache (&target_sec_cache);
57 + free_section_cache (&target_sec_cache);
59 release_contents (sec, contents);
60 release_internal_relocs (sec, internal_relocs);