goto fail;
size = grub_file_size (file);
- module = grub_memalign (MULTIBOOT_MOD_ALIGN, size);
- if (! module)
+ err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &module,
+ &target,
+ 0, (0xffffffff - size) + 1,
+ size, MULTIBOOT_MOD_ALIGN,
+ GRUB_RELOCATOR_PREFERENCE_NONE);
+ if (err)
+ goto fail;
+
+ err = grub_multiboot_add_module (target, size, argc - 1, argv + 1);
+ if (err)
goto fail;
+ err = grub_multiboot_add_module ((grub_addr_t) module, size,
+ argc - 1, argv + 1);
+ if (err)
+ goto fail;
+
if (grub_file_read (file, module, size) != size)
{
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");