summaryrefslogtreecommitdiff
path: root/pe.c
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2023-01-22 13:05:10 +0000
committerSteve McIntyre <steve@einval.com>2023-01-22 13:05:10 +0000
commit2dd2f7600d41253fe621b8d040ab57f0c202d71b (patch)
tree603ffd3c05d9935fd879bb073f6d3edc672139cf /pe.c
parente6ace38abd705fbe24349152b7c90d473404e86e (diff)
downloadefi-boot-shim-upstream/15.7.tar.gz
efi-boot-shim-upstream/15.7.zip
New upstream version 15.7upstream/15.7
Diffstat (limited to 'pe.c')
-rw-r--r--pe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pe.c b/pe.c
index ba3e2bbc..9a3679e1 100644
--- a/pe.c
+++ b/pe.c
@@ -1196,6 +1196,9 @@ handle_image (void *data, unsigned int datasize,
CopyMem(buffer, data, context.SizeOfHeaders);
+ /* Flush the instruction cache for the region holding the image */
+ cache_invalidate(buffer, buffer + context.ImageSize);
+
*entry_point = ImageAddress(buffer, context.ImageSize, context.EntryPoint);
if (!*entry_point) {
perror(L"Entry point is invalid\n");
@@ -1256,7 +1259,7 @@ handle_image (void *data, unsigned int datasize,
}
if (Section->VirtualAddress <= context.EntryPoint &&
- (Section->VirtualAddress + Section->SizeOfRawData - 1)
+ (Section->VirtualAddress + Section->Misc.VirtualSize - 1)
> context.EntryPoint)
found_entry_point++;