diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-fix-ineffectual-zero-of-cache.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-fix-ineffectual-zero-of-cache.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-fix-ineffectual-zero-of-cache.patch b/meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-fix-ineffectual-zero-of-cache.patch new file mode 100644 index 0000000000..a4aebf3be0 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-fix-ineffectual-zero-of-cache.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | * elf32-xtensa.c | ||
4 | * (free_section_cache): Renamed from clear_section_cache. | ||
5 | * (section_cache_section): Remove ineffectual zero of cache. | ||
6 | Call init_section_cache instead. | ||
7 | |||
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)); | ||
11 | ^ | ||
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)); | ||
14 | |||
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 | ||
16 | |||
17 | Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> | ||
18 | |||
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 | ||
21 | @@ -6067,7 +6067,7 @@ | ||
22 | |||
23 | |||
24 | static void | ||
25 | -clear_section_cache (section_cache_t *sec_cache) | ||
26 | +free_section_cache (section_cache_t *sec_cache) | ||
27 | { | ||
28 | if (sec_cache->sec) | ||
29 | { | ||
30 | @@ -6075,7 +6075,6 @@ | ||
31 | release_internal_relocs (sec_cache->sec, sec_cache->relocs); | ||
32 | if (sec_cache->ptbl) | ||
33 | free (sec_cache->ptbl); | ||
34 | - memset (sec_cache, 0, sizeof (sec_cache)); | ||
35 | } | ||
36 | } | ||
37 | |||
38 | @@ -6116,8 +6115,8 @@ | ||
39 | goto err; | ||
40 | |||
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); | ||
46 | |||
47 | sec_cache->sec = sec; | ||
48 | sec_cache->contents = contents; | ||
49 | @@ -8272,8 +8271,9 @@ | ||
50 | #endif /* DEBUG */ | ||
51 | |||
52 | error_return: | ||
53 | - if (prop_table) free (prop_table); | ||
54 | - clear_section_cache (&target_sec_cache); | ||
55 | + if (prop_table) | ||
56 | + free (prop_table); | ||
57 | + free_section_cache (&target_sec_cache); | ||
58 | |||
59 | release_contents (sec, contents); | ||
60 | release_internal_relocs (sec, internal_relocs); | ||