aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2015-04-10 12:18:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-15 14:18:54 +0100
commitc46661bf4ffe1a474e4bcfadb4a3f12a46e8cc4a (patch)
tree2fc4ded1d06b5d8938ea109b6e54f169608aa036 /meta/recipes-devtools
parent649110f5ab435231153e8f309ad2370e76c31e4f (diff)
downloadopenembedded-core-contrib-c46661bf4ffe1a474e4bcfadb4a3f12a46e8cc4a.tar.gz
elfutils: fix build with -Os
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.161/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch35
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.161.bb1
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.161/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch b/meta/recipes-devtools/elfutils/elfutils-0.161/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
new file mode 100644
index 00000000000..3754c1c361a
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.161/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
@@ -0,0 +1,35 @@
+From 668accf322fd7185e273bfd50b84320e71d9de5a Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 10 Apr 2015 00:29:18 +0200
+Subject: [PATCH] elf_getarsym: Silence -Werror=maybe-uninitialized false
+ positive
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ libelf/elf_getarsym.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c
+index d0bb28a..08954d2 100644
+--- a/libelf/elf_getarsym.c
++++ b/libelf/elf_getarsym.c
+@@ -165,8 +165,13 @@ elf_getarsym (elf, ptr)
+ int w = index64_p ? 8 : 4;
+
+ /* We have an archive. The first word in there is the number of
+- entries in the table. */
+- uint64_t n;
++ entries in the table.
++ Set to SIZE_MAX just to silence -Werror=maybe-uninitialized
++ elf_getarsym.c:290:9: error: 'n' may be used uninitialized in this function
++ The read_number_entries function doesn't initialize n only when returning
++ -1 which in turn ensures to jump over usage of this uninitialized variable.
++ */
++ uint64_t n = SIZE_MAX;
+ size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
+ if (read_number_entries (&n, elf, &off, index64_p) < 0)
+ {
+--
+2.3.5
+
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.161.bb b/meta/recipes-devtools/elfutils/elfutils_0.161.bb
index c18222de3c4..35bf0b6cd9e 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.161.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.161.bb
@@ -15,6 +15,7 @@ SRC_URI += "\
file://dso-link-change.patch \
file://Fix_elf_cvt_gunhash.patch \
file://fixheadercheck.patch \
+ file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
"
# pick the patch from debian