src/image.c: remove alignment of regions

The old code forced region size to be aligned to the PECOFF file
alignment parameter, which is correct according to the spec.  However,
the major UEFI platforms do not align up when checking the signature,
so if the PECOFF binary being signed already contains a signature,
realigning the sections will make the existing signature invalid.  Fix
this by relaxing the rule about aligning up (also eliminates
complaints about some pecoff sections being misaligned).

Signed-off-by: James Bottomley <>
diff --git a/src/image.c b/src/image.c
index 3e655cc..745191f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -388,8 +388,7 @@
 		regions = image->checksum_regions;
 		regions[n].data = buf + file_offset;
-		regions[n].size = align_up(file_size,
-					image->file_alignment);
+		regions[n].size = file_size;
 		regions[n].name = talloc_strndup(image->checksum_regions,
 					image->scnhdr[i].s_name, 8);
 		bytes += regions[n].size;