diff options
author | Zhenhua Luo <zhenhua.luo@freescale.com> | 2013-03-13 15:43:04 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-15 01:52:54 +0000 |
commit | 5445e12e5a32cc5c51ce8a29f2800692ed831115 (patch) | |
tree | c61b0a9755a7af29773c78edc3bc117a72821a7f /meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-replace-strncat-with-strcat.patch | |
parent | c2a2ac579876695c162ccca0ca3673f4d06ce60e (diff) | |
download | openembedded-core-contrib-5445e12e5a32cc5c51ce8a29f2800692ed831115.tar.gz |
binutils: fix ineffectual zero of cache and array bounds issue
binutils build fails on Fedora18+:
1. 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]
memset (sec_cache, 0, sizeof (sec_cache));
^
2. 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]
memset (sec_cache, 0, sizeof (sec_cache));
^
3. binutils-2.23.1/opcodes/arc-dis.c:430:13: error: argument to 'sizeof' in '__builtin_strncat' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
sizeof (state->commentBuffer));
^
4. binutils-2.23.1/opcodes/rl78-dis.c:230:13: error: array subscript is above array bounds [-Werror=array-bounds]
if (oper->use_es && indirect_type (oper->type))
^
Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-replace-strncat-with-strcat.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-replace-strncat-with-strcat.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-replace-strncat-with-strcat.patch b/meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-replace-strncat-with-strcat.patch new file mode 100644 index 0000000000..bc8f92b8ae --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.23.1/backport/binutils-replace-strncat-with-strcat.patch @@ -0,0 +1,26 @@ +Upstream-Status: Backport + +* arc-dis.c (write_comments_): Don't use strncat due to + the size of state->commentBuffer pointer isn't predictable. + +binutils build will fail on Fedora18+. +binutils-2.23.1/opcodes/arc-dis.c:430:13: error: argument to 'sizeof' in '__builtin_strncat' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] + sizeof (state->commentBuffer)); + ^ + +The original commit is http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/arc-dis.c.diff?r1=1.17&r2=1.18&cvsroot=src + +Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> + +--- binutils-2.23.1/opcodes/arc-dis.c.orig 2013-03-13 00:10:27.978498158 -0500 ++++ binutils-2.23.1/opcodes/arc-dis.c 2013-03-13 00:11:28.297499381 -0500 +@@ -426,8 +426,7 @@ + strcpy (state->commentBuffer, comment_prefix); + else + strcat (state->commentBuffer, ", "); +- strncat (state->commentBuffer, state->comm[i], +- sizeof (state->commentBuffer)); ++ strcat (state->commentBuffer, state->comm[i]); + } + } + } |