grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

does module area require alignment? (Re: [PATCH] i386-qemu port)


From: Robert Millan
Subject: does module area require alignment? (Re: [PATCH] i386-qemu port)
Date: Sun, 21 Jun 2009 20:50:09 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jun 21, 2009 at 08:17:48PM +0200, Robert Millan wrote:
>  grub_addr_t
>  grub_arch_modules_addr (void)
>  {
> -  return ALIGN_UP((grub_addr_t) _end, GRUB_MOD_ALIGN);
> +//  return ALIGN_UP((grub_addr_t) _end, GRUB_MOD_ALIGN);
> +  return _end;
>  }

Some comments on this one.  It seems coreboot cares about alignment in
modbase because all ELF targets do.  This comes from elf/grub-mkimage.c:

      /* Place modules just after grub segment.  */
      modbase = ALIGN_UP(grub_end + GRUB_MOD_GAP, GRUB_MOD_ALIGN);

However, I don't see why this is necessary.  The module area is unaligned
on i386-pc and this works just fine there.  Same for i386-qemu.

Does anyone know why do we align ELF targets?  When I did the coreboot port,
the ELF part was based on existing Ieee1275 code, so I guess I just mimicked
it.  Is there some issue with non-i386 CPUs or with some Ieee1275
implementations that makes this alignment a requirement?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]