@@ -205,13 +205,19 @@ grub_multiboot2_load (grub_file_t file, const char *filename)
case MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS:
entry_specified = 1;
- entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr;
+ if ((tag->size - sizeof(struct multiboot_header_tag)) == sizeof(multiboot_uint64_t))
+ entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr64;
+ else
+ entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr32;
break;
case MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64:
#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__)
efi_entry_specified = 1;
- efi_entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr;
+ if ((tag->size - sizeof(struct multiboot_header_tag)) == sizeof(multiboot_uint64_t))
+ efi_entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr64;
+ else
+ efi_entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr32;
#endif
break;
@@ -140,7 +140,11 @@ struct multiboot_header_tag_entry_address
multiboot_uint16_t type;
multiboot_uint16_t flags;
multiboot_uint32_t size;
- multiboot_uint32_t entry_addr;
+ union
+ {
+ multiboot_uint32_t entry_addr32;
+ multiboot_uint64_t entry_addr64;
+ };
};
struct multiboot_header_tag_console_flags
Add support for entry addresses that may be either 32 bits or 64 bits in size. This may be necessary if the binary is built with an entry address above 4G. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> --- grub-core/loader/multiboot_mbi2.c | 10 ++++++++-- include/multiboot2.h | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-)