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@chromium.org>
Reviewed-on: http://review.coreboot.org/6737
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Aaron Durbin 2014-08-22 14:05:00 -05:00 committed by Aaron Durbin
parent f99a62b65e
commit bc349b81e9
1 changed files with 2 additions and 1 deletions

View File

@ -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);