From 6a249d688ec4922e01e1143863a70a57bd0e51fd Mon Sep 17 00:00:00 2001 From: Ivan Jager Date: Sat, 23 Sep 2023 08:34:32 -0500 Subject: [PATCH] cbfs: Restore 32-bit padding in cbfs_header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was changed from a fixed size-1 array to a flexible array in commit 242bac0e162c ("…: Use C99 flexible arrays") which resulted in a change to the serialized format as the header size was no longer the same. That broke other tools that read CBFS files, like diffoscope https://github.com/NixOS/nixpkgs/issues/256896 Change-Id: I4199dcc4823469c5986ac967a55b1c85cc62f780 Signed-off-by: Ivan Jager Reviewed-on: https://review.coreboot.org/c/coreboot/+/78239 Reviewed-by: Julius Werner Reviewed-by: Kyösti Mälkki Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/commonlib/bsd/include/commonlib/bsd/cbfs_serialized.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commonlib/bsd/include/commonlib/bsd/cbfs_serialized.h b/src/commonlib/bsd/include/commonlib/bsd/cbfs_serialized.h index 07d3d9de4d..cebaf8395e 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/cbfs_serialized.h +++ b/src/commonlib/bsd/include/commonlib/bsd/cbfs_serialized.h @@ -60,7 +60,7 @@ struct cbfs_header { uint32_t align; /* fixed to 64 bytes */ uint32_t offset; uint32_t architecture; - uint32_t pad[]; + uint32_t pad[1]; } __packed; /* this used to be flexible, but wasn't ever set to something different. */