]> git.ipfire.org Git - thirdparty/grub.git/commit
util/mkimage: Improve data_size value calculation
authorPeter Jones <pjones@redhat.com>
Thu, 11 Feb 2021 16:07:33 +0000 (17:07 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:19 +0000 (15:54 +0100)
commitff406eff25465932b97a2857ee5a75fd0957e9b9
tree6e3e27aaee488965ed878b17b3f69533a3c1d843
parentba44c87e56a8bccde235ebb7d41d5aa54604d241
util/mkimage: Improve data_size value calculation

According to "Microsoft Portable Executable and Common Object File Format
Specification", the Optional Header SizeOfInitializedData field contains:

  Size of the initialized data section, or the sum of all such sections if
  there are multiple data sections.

Make this explicit by adding the GRUB kernel data size to the sum of all
the modules sizes. The ALIGN_UP() is not required by the PE spec but do
it to avoid alignment issues.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/mkimage.c