coreboot-kgpe-d16/util/cbfstool
Ronald G. Minnich a8a133ded3 Add section header parsing and use it in the mk-payload step
This completes the improvements to the ELF file parsing code.  We can
now parse section headers too, across all 4 combinations of word size
and endianness. I had hoped to completely remove the use of htonl
until I found it in cbfs_image.c. That's a battle for another day.

There's now a handy macro to create magic numbers in host byte order.
I'm using it for all the PAYLOAD_SEGMENT_* constants and maybe
we can use it for the others too, but this is sensitive code and
I'd rather change one thing at a time.

To maximize the ease of use for users, elf parsing is accomplished with
just one function:

int
elf_headers(const struct buffer *pinput,
	    Elf64_Ehdr *ehdr,
	    Elf64_Phdr **pphdr,
	    Elf64_Shdr **pshdr)

which requires the ehdr and pphdr pointers to be non-NULL, but allows
the pshdr to be NULL. If pshdr is NULL, the code will not try to read
in section headers.

To satisfy our powerful scripts, I had to remove the ^M from an unrelated
microcode file.

BUG=None
TEST=Build a peppy image (known to boot) with old and new versions and verify they are bit-for-bit the same. This was also fully tested across all chromebooks for building and booting and running chromeos.
BRANCH=None

Change-Id: I54dad887d922428b6175fdb6a9cdfadd8a6bb889
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://chromium-review.googlesource.com/181272
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Ronald Minnich <rminnich@chromium.org>
Tested-by: Ronald Minnich <rminnich@chromium.org>
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: http://review.coreboot.org/5098
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2014-02-02 20:18:55 +01:00
..
lzma cbfstool/lzma: Avoid use of typedef with structs and enums 2014-01-29 20:06:26 +01:00
cbfs-mkpayload.c Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
cbfs-mkstage.c Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
cbfs-payload-linux.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
cbfs.h Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
cbfs_image.c Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
cbfs_image.h cbfstool locate: Implement alignment switch --align/-a 2013-03-20 05:47:32 +01:00
cbfstool.c Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
coff.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
common.c Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
common.h Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
compress.c cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +01:00
elf.h cbfstool: add a constant for the aarch64 2013-11-18 16:58:58 +01:00
elfheaders.c Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
EXAMPLE cbfstool: Update example file. 2013-02-04 11:12:15 +01:00
fit.c Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
fit.h cbfstool: Add update-fit command 2013-03-27 01:25:12 +01:00
fv.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
linux.h Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
linux_trampoline.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
Makefile Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
Makefile.inc Add section header parsing and use it in the mk-payload step 2014-02-02 20:18:55 +01:00
swab.h Various fixes to cbfstool. 2011-10-24 20:29:29 +02:00
xdr.c cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +01:00