From 8458bf648fd75c5815c1351809d122f155bc7748 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Thu, 11 Oct 2018 04:09:58 -0700 Subject: efi_loader: set image_base and image_size to correct values Currently, image's image_base points to an address where the image was temporarily uploaded for further loading. Since efi_loader relocates the image to final destination, image_base and image_size should reflect that. This bug was detected in UEFI SCT, "Loaded Image Protocol Test - test 2," which shows that 'Unload' function doesn't fit into a range suggested by image_base and image_size. TestCase/UEFI/EFI/Protocol/LoadedImage/BlackBoxTest/ LoadedImageBBTestMain.c:1002 Changes in this patch also includes: * reverts a patch, "efi_loader: save image relocation address and size" since newly added fields are no longer needed. * copy PE headers as well since those information will be needed for module loading, in particular, at gurb. (This bug was reported by Heinrich.) Reported-by: Heinrich Schuchardt Signed-off-by: AKASHI Takahiro Rebase patch. Remove unused fields from struct efi_loaded_image_obj. Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/efi_loader.h') diff --git a/include/efi_loader.h b/include/efi_loader.h index 512880ab8f..9f776021ab 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -203,15 +203,11 @@ struct efi_object { * struct efi_loaded_image_obj - handle of a loaded image * * @header: EFI object header - * @reloc_base: base address for the relocated image - * @reloc_size: size of the relocated image * @exit_jmp: long jump buffer for returning form started image * @entry: entry address of the relocated image */ struct efi_loaded_image_obj { struct efi_object header; - void *reloc_base; - aligned_u64 reloc_size; efi_status_t exit_status; struct jmp_buf_data exit_jmp; EFIAPI efi_status_t (*entry)(efi_handle_t image_handle, -- cgit v1.2.3