elfutils: fix stack usage warning

(From OE-Core rev: 80d6a1c249ae8cd7b0bdc011a2d680221799cc83)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Roy Li
2015-07-13 09:52:36 +08:00
committed by Richard Purdie
parent 133ad63987
commit 8f270dc404
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
[PATCH] fix a stack-usage warning
Upstream-Status: Pending
not use a variable to as a array size, otherwise the warning to error that
stack usage might be unbounded [-Werror=stack-usage=] will happen
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
backends/ppc_initreg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
index 64f5379..52dde3e 100644
--- a/backends/ppc_initreg.c
+++ b/backends/ppc_initreg.c
@@ -93,7 +93,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
return false;
}
const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr);
- Dwarf_Word dwarf_regs[gprs];
+ Dwarf_Word dwarf_regs[sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr)];
for (unsigned gpr = 0; gpr < gprs; gpr++)
dwarf_regs[gpr] = user_regs.r.gpr[gpr];
if (! setfunc (0, gprs, dwarf_regs, arg))
--
1.9.1

View File

@@ -17,6 +17,7 @@ SRC_URI += "\
file://fixheadercheck.patch \
file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
file://0001-remove-the-unneed-checking.patch \
file://0001-fix-a-stack-usage-warning.patch \
"
# pick the patch from debian