summaryrefslogtreecommitdiffstats
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:19:45 +0100
commit31b2c1ff883370aeef28aa9d1efe0e14f3685c21 (patch)
tree0f0a228aca9c91c69dadc64106f47e1adf33d79e /meta/recipes-devtools
parent1b4f7174c1805363ee1b939d4e4e9367571bb17e (diff)
downloadpoky-31b2c1ff883370aeef28aa9d1efe0e14f3685c21.tar.gz
elfutils: fix build with -Os
(From OE-Core rev: c46661bf4ffe1a474e4bcfadb4a3f12a46e8cc4a) 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 0000000000..3754c1c361
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.161/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
@@ -0,0 +1,35 @@
1From 668accf322fd7185e273bfd50b84320e71d9de5a Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 10 Apr 2015 00:29:18 +0200
4Subject: [PATCH] elf_getarsym: Silence -Werror=maybe-uninitialized false
5 positive
6
7Upstream-Status: Pending
8Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
9---
10 libelf/elf_getarsym.c | 9 +++++++--
11 1 file changed, 7 insertions(+), 2 deletions(-)
12
13diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c
14index d0bb28a..08954d2 100644
15--- a/libelf/elf_getarsym.c
16+++ b/libelf/elf_getarsym.c
17@@ -165,8 +165,13 @@ elf_getarsym (elf, ptr)
18 int w = index64_p ? 8 : 4;
19
20 /* We have an archive. The first word in there is the number of
21- entries in the table. */
22- uint64_t n;
23+ entries in the table.
24+ Set to SIZE_MAX just to silence -Werror=maybe-uninitialized
25+ elf_getarsym.c:290:9: error: 'n' may be used uninitialized in this function
26+ The read_number_entries function doesn't initialize n only when returning
27+ -1 which in turn ensures to jump over usage of this uninitialized variable.
28+ */
29+ uint64_t n = SIZE_MAX;
30 size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
31 if (read_number_entries (&n, elf, &off, index64_p) < 0)
32 {
33--
342.3.5
35
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.161.bb b/meta/recipes-devtools/elfutils/elfutils_0.161.bb
index c18222de3c..35bf0b6cd9 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 += "\
15 file://dso-link-change.patch \ 15 file://dso-link-change.patch \
16 file://Fix_elf_cvt_gunhash.patch \ 16 file://Fix_elf_cvt_gunhash.patch \
17 file://fixheadercheck.patch \ 17 file://fixheadercheck.patch \
18 file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
18" 19"
19 20
20# pick the patch from debian 21# pick the patch from debian