/* Fill in the rest of the segment header. */
phdr->p_type = grub_host_to_target32 (PT_NOTE);
phdr->p_flags = grub_host_to_target32 (PF_R);
- phdr->p_align = grub_host_to_target32 (sizeof (long));
+ phdr->p_align = grub_host_to_target32 (GRUB_TARGET_SIZEOF_LONG);
phdr->p_vaddr = 0;
phdr->p_paddr = 0;
phdr->p_filesz = grub_host_to_target32 (note_size);
/* Fill in the rest of the segment header. */
phdr->p_type = grub_host_to_target32 (PT_LOAD);
phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X);
- phdr->p_align = grub_host_to_target32 (sizeof (long));
+ phdr->p_align = grub_host_to_target32 (GRUB_TARGET_SIZEOF_LONG);
phdr->p_vaddr = grub_host_to_target32 (modbase);
phdr->p_paddr = grub_host_to_target32 (modbase);
phdr->p_filesz = grub_host_to_target32 (total_module_size);
grub_util_read_at (&ehdr, sizeof (ehdr), 0, in);
- offset = ALIGN_UP (sizeof (ehdr), sizeof (long));
+ offset = ALIGN_UP (sizeof (ehdr), GRUB_TARGET_SIZEOF_LONG);
ehdr.e_phoff = grub_host_to_target32 (offset);
phdr_size = (grub_target_to_host16 (ehdr.e_phentsize) *
phdr_size += grub_target_to_host16 (ehdr.e_phentsize);
phdrs = xmalloc (phdr_size);
- offset += ALIGN_UP (phdr_size, sizeof (long));
+ offset += ALIGN_UP (phdr_size, GRUB_TARGET_SIZEOF_LONG);
/* Copy all existing segments. */
for (i = 0; i < grub_target_to_host16 (ehdr.e_phnum); i++)
phdr->p_offset = grub_host_to_target32 (offset);
grub_util_write_image_at (segment_img, grub_target_to_host32 (phdr->p_filesz),
offset, out);
- offset += ALIGN_UP (grub_target_to_host32 (phdr->p_filesz), sizeof (long));
+ offset += ALIGN_UP (grub_target_to_host32 (phdr->p_filesz),
+ GRUB_TARGET_SIZEOF_LONG);
free (segment_img);
}
/* Fill in p_offset so the callees know where to write. */
phdr->p_offset = grub_host_to_target32 (ALIGN_UP (grub_util_get_fp_size (out),
- sizeof (long)));
+ GRUB_TARGET_SIZEOF_LONG));
load_modules (modbase, phdr, dir, mods, out);
}
/* Fill in p_offset so the callees know where to write. */
phdr->p_offset = grub_host_to_target32 (ALIGN_UP (grub_util_get_fp_size (out),
- sizeof (long)));
+ GRUB_TARGET_SIZEOF_LONG));
load_note (phdr, out);
}