coreboot-kgpe-d16/util/cbfstool
Julius Werner 5779ca718c cbfstool: Replace FILENAME_ALIGN 16 with ATTRIBUTE_ALIGN 4
cbfstool has always had a CBFS_FILENAME_ALIGN that forces the filename
field to be aligned upwards to the next 16-byte boundary. This was
presumably done to align the file contents (which used to come
immediately after the filename field).

However, this hasn't really worked right ever since we introduced CBFS
attributes. Attributes come between the filename and the contents, so
what this code currently does is fill up the filename field with extra
NUL-bytes to the boundary, and then just put the attributes behind it
with whatever size they may be. The file contents don't end up with any
alignment guarantee and the filename field is just wasting space.

This patch removes the old FILENAME_ALIGN, and instead adds a new
alignment of 4 for the attributes. 4 seems like a reasonable alignment
to enforce since all existing attributes (with the exception of weird
edge cases with the padding attribute) already use sizes divisible by 4
anyway, and the common attribute header fields have a natural alignment
of 4. This means file contents will also have a minimum alignment
guarantee of 4 -- files requiring a larger guarantee can still be added
with the --alignment flag as usual.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I43f3906977094df87fdc283221d8971a6df01b53
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47827
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2021-02-18 02:32:45 +00:00
..
console treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
flashmap util: Use SPDX headers 2020-05-11 19:38:40 +00:00
lz4
lzma
.gitignore util/cbfstool/.gitignore: Add ifittool 2020-12-07 14:02:38 +00:00
EXAMPLE
Makefile util/cbfstool: Add SPDX header to generated linux_trampoline code, too 2020-05-11 19:39:12 +00:00
Makefile.inc cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
ProcessorBind.h util: Use SPDX headers 2020-05-11 19:38:40 +00:00
amdcompress.c util/cbfstool/amdcompress: fix argument requirement 2020-11-15 16:49:30 +00:00
cbfs-mkpayload.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
cbfs-mkstage.c cbfstool: Remove location pointer from parse_elf_to_stage() 2021-02-18 02:32:28 +00:00
cbfs-payload-linux.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
cbfs.h cbfs: Add verification for RO CBFS metadata hash 2020-12-03 00:11:08 +00:00
cbfs_image.c cbfstool: Replace FILENAME_ALIGN 16 with ATTRIBUTE_ALIGN 4 2021-02-18 02:32:45 +00:00
cbfs_image.h cbfstool: Hide hash printing behind -v and add to parseable output 2020-12-03 00:08:03 +00:00
cbfs_sections.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
cbfs_sections.h util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
cbfscomptool.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
cbfstool.c cbfstool: Replace FILENAME_ALIGN 16 with ATTRIBUTE_ALIGN 4 2021-02-18 02:32:45 +00:00
coff.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
common.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
common.h cbfstool: Remove location pointer from parse_elf_to_stage() 2021-02-18 02:32:28 +00:00
compress.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
default-x86.fmd drivers/vpd: Add VPD region to default FMAP when selected 2021-01-04 23:12:35 +00:00
default.fmd
description.md
elf.h util: Use SPDX headers 2020-05-11 19:38:40 +00:00
elfheaders.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
elfparsing.h util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
fdt.h treewide: replace GPLv2 long form headers with SPDX header 2020-05-06 22:20:57 +00:00
fit.c util/cbfstool/fit.c: Add support for adding Boot Guard manifests 2020-12-11 07:33:51 +00:00
fit.h util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
flashmap_tests.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
fmap_from_fmd.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
fmap_from_fmd.h util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
fmaptool.c util/cbfstool/fmaptool: Generate list of terminal sections 2020-12-08 18:59:05 +00:00
fmd.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
fmd.h util/cbfstool/fmd: make flashmap_flags bitfield struct elements unsigned 2020-09-23 13:39:14 +00:00
fmd_parser.c_shipped
fmd_parser.h_shipped
fmd_parser.y util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
fmd_scanner.c_shipped treewide: Remove trailing whitespace 2021-02-17 17:30:05 +00:00
fmd_scanner.h_shipped treewide: Remove trailing whitespace 2021-02-17 17:30:05 +00:00
fmd_scanner.l util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
fv.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
ifittool.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
ifwitool.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
linux.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
linux_trampoline.S util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
linux_trampoline.c util/cbfstool: Add SPDX header to generated linux_trampoline code, too 2020-05-11 19:39:12 +00:00
linux_trampoline.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
option.h util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
partitioned_file.c util/cbfstool: unbreak compilation on FreeBSD 2021-01-13 12:07:17 +00:00
partitioned_file.h util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
rmodtool.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00
rmodule.c rmodtool: Make memlayout symbols absolute and do not relocate them 2021-02-18 02:32:06 +00:00
rmodule.h rmodtool: Make memlayout symbols absolute and do not relocate them 2021-02-18 02:32:06 +00:00
swab.h
xdr.c util/: Replace GPLv2 boiler plate with SPDX header 2020-05-09 21:22:08 +00:00