From bc349b81e97350b13d7d70c400e46d0bb8e4d1aa Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 22 Aug 2014 14:05:00 -0500 Subject: elfheaders: fix 64-bit ELF writing The sh_flags for a 64-bit section header entry are 64-bit in size. Correct this. Change-Id: I2fa79d9a0fb46cc1dfa97c172357bbd2394843e0 Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/6737 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- util/cbfstool/elfheaders.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/cbfstool') diff --git a/util/cbfstool/elfheaders.c b/util/cbfstool/elfheaders.c index 71d34a9df5..fdd1599199 100644 --- a/util/cbfstool/elfheaders.c +++ b/util/cbfstool/elfheaders.c @@ -781,8 +781,8 @@ static void shdr_write(struct elf_writer *ew, size_t n, struct buffer *m) xdr->put32(m, shdr->sh_name); xdr->put32(m, shdr->sh_type); - xdr->put32(m, shdr->sh_flags); if (bit64) { + xdr->put64(m, shdr->sh_flags); xdr->put64(m, shdr->sh_addr); xdr->put64(m, shdr->sh_offset); xdr->put64(m, shdr->sh_size); @@ -791,6 +791,7 @@ static void shdr_write(struct elf_writer *ew, size_t n, struct buffer *m) xdr->put64(m, shdr->sh_addralign); xdr->put64(m, shdr->sh_entsize); } else { + xdr->put32(m, shdr->sh_flags); xdr->put32(m, shdr->sh_addr); xdr->put32(m, shdr->sh_offset); xdr->put32(m, shdr->sh_size); -- cgit v1.2.3