From 5a1af7b877192143fdb12f98062caa458a1e02e0 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Thu, 17 Sep 2009 15:35:08 +0000 Subject: There was a missing addition of the size of the .notes.pinfo section header which could lead to corrupted malloc arena. Also, make cbfstool always build with debugging on. Performance is not an issue here. Don't strip it either. Signed-off-by: Ronald G. Minnich Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4641 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/cbfstool/Makefile | 2 ++ util/cbfstool/cbfs-mkpayload.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'util/cbfstool') diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile index 94712bdd6d..d74c44ee5d 100644 --- a/util/cbfstool/Makefile +++ b/util/cbfstool/Makefile @@ -2,6 +2,8 @@ obj ?= $(shell pwd) HOSTCXX ?= g++ HOSTCC ?= gcc +CFLAGS ?= -g + BINARY:=$(obj)/cbfstool diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c index 4f0e248123..f8cc1616b0 100644 --- a/util/cbfstool/cbfs-mkpayload.c +++ b/util/cbfstool/cbfs-mkpayload.c @@ -75,8 +75,10 @@ int parse_elf_to_payload(unsigned char *input, unsigned char **output, name = (char *)(strtab + shdr[i].sh_name); - if (!strcmp(name, ".note.pinfo")) + if (!strcmp(name, ".note.pinfo")) { segments++; + isize += (unsigned int)shdr[i].sh_size; + } } /* Now, regular headers - we only care about PT_LOAD headers, -- cgit v1.2.3