coreboot-kgpe-d16/util/cbfstool
Ronald G. Minnich aa2f739ae8 cbfs: fix issues with word size and endianness.
Add XDR functions and use them to convert the ELF headers
to native headers, using the Elf64 structs to ensure we accomodate
all word sizes. Also, use these XDR functions for output.

This may seem overly complex but it turned out to be much the easiest
way to do this. Note that the basic elf parsing function
in cbfs-mkstage.c now works over all ELF files, for all architectures,
endian, and word size combinations. At the same time, the basic elf
parsing in cbfs-mkstage.c is a loop that has no architecture-specific
conditionals.

Add -g to the LDFLAGS while we're here. It's on the CFLAGS so there is
no harm done.

This code has been tested on all chromebooks that use coreboot to date.

I added most of the extra checks from ChromeOS and they triggered a
lot of warnings, hence the other changes. I had to take -Wshadow back
out due to the many errors it triggers in LZMA.

BUG=None
TEST=Build and boot for Peppy; works fine. Build and boot for nyan,
     works fine. Build for qemu targets and armv8 targets.
BRANCH=None

Change-Id: I5a4cee9854799189115ac701e22efc406a8d902f
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://chromium-review.googlesource.com/178606
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Ronald Minnich <rminnich@chromium.org>
Tested-by: Ronald Minnich <rminnich@chromium.org>
Reviewed-on: http://review.coreboot.org/4817
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2014-01-29 20:03:44 +01:00
..
lzma Fix whitespace leaked into tree 2013-09-17 21:04:35 +02:00
EXAMPLE cbfstool: Update example file. 2013-02-04 11:12:15 +01:00
Makefile cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +01:00
Makefile.inc cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +01:00
cbfs-mkpayload.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
cbfs-mkstage.c cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +01:00
cbfs-payload-linux.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
cbfs.h cbfstool: Use cbfs_image API for "print" command. 2013-02-05 22:25:13 +01:00
cbfs_image.c cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +01:00
cbfs_image.h cbfstool locate: Implement alignment switch --align/-a 2013-03-20 05:47:32 +01:00
cbfstool.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02: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 cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +01:00
common.h cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +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
fit.c cbfs: fix issues with word size and endianness. 2014-01-29 20:03:44 +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
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