[coreboot] Patch set updated for coreboot: 017a78a correctly mark code segments as code in SELF

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Wed Mar 7 09:27:43 CET 2012

Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/767


commit 017a78ac20a97394921f53b29875f0ec76c73a9b
Author: Stefan Reinauer <reinauer at chromium.org>
Date:   Wed Jan 11 12:40:14 2012 -0800

    correctly mark code segments as code in SELF
    In bios_log, find that the first segment of the payload is shown
    as code rather than data.
           Got a payload
           Loading segment from rom address 0xfff29378
             code (compression=1)
    Change-Id: I82eaad23f08c02f4ed75744affa8835255cf5c17
    Signed-off-by: Stefan Reinauer <reinauer at google.com>
 util/cbfstool/cbfs-mkpayload.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c
index ff6479d..e4ef5c8 100644
--- a/util/cbfstool/cbfs-mkpayload.c
+++ b/util/cbfstool/cbfs-mkpayload.c
@@ -161,7 +161,10 @@ int parse_elf_to_payload(unsigned char *input, unsigned char **output,
-		segs[segments].type = PAYLOAD_SEGMENT_DATA;
+		if (phdr[i].p_flags & PF_X)
+			segs[segments].type = PAYLOAD_SEGMENT_CODE;
+		else
+			segs[segments].type = PAYLOAD_SEGMENT_DATA;
 		segs[segments].load_addr = (uint64_t)htonll(phdr[i].p_paddr);
 		segs[segments].mem_len = (uint32_t)htonl(phdr[i].p_memsz);
 		segs[segments].compression = htonl(algo);

More information about the coreboot mailing list