[coreboot-gerrit] New patch to review for coreboot: bace5ce elfheaders: fix 64-bit ELF writing
Aaron Durbin (adurbin@google.com)
gerrit at coreboot.org
Fri Aug 22 21:07:19 CEST 2014
Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6737
-gerrit
commit bace5ce9dde795af541e46198d2ea358cc74b5ee
Author: Aaron Durbin <adurbin at chromium.org>
Date: Fri Aug 22 14:05:00 2014 -0500
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 <adurbin at chromium.org>
---
util/cbfstool/elfheaders.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/cbfstool/elfheaders.c b/util/cbfstool/elfheaders.c
index 71d34a9..fdd1599 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);
More information about the coreboot-gerrit
mailing list