grub-devel
[Top][All Lists]
Advanced

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

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


From: Vladimir 'phcoder' Serbinenko
Subject: Re: does module area require alignment? (Re: [PATCH] i386-qemu port)
Date: Tue, 23 Jun 2009 00:50:10 +0200



On Mon, Jun 22, 2009 at 9:51 PM, Pavel Roskin <address@hidden> wrote:
On Sun, 2009-06-21 at 21:33 +0200, Robert Millan wrote:
> On Sun, Jun 21, 2009 at 03:08:19PM -0400, Pavel Roskin wrote:
> > On Sun, 2009-06-21 at 20:50 +0200, Robert Millan wrote:
> >
> > > 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?
> >
> > It was a hack for PowerPC openfirmware.  I don't know why it was needed.
> > I didn't have time and desire to debug openfirmware to find out what it
> > wants.
>
> Is the hack you're referring to GRUB_MOD_GAP, GRUB_MOD_ALIGN or both?

I'm referring to GRUB_MOD_GAP.

> Btw, I suspect GRUB_MOD_GAP might be related to the modules overlapping with
> the BSS because of a firmware loader bug.  Is there a correlation between
> the needed GRUB_MOD_GAP and the BSS size?

I don't see any correlation.

I made 3 images with the gap of 0x4000, 0x8000 and 0xc000.  Then I added
an uninitialized array to the kernel, 0x4000 bytes long, and made
another 3 images with the same gap sizes.  The images with the 0x4000
gap don't boot and the images with the gap sized 0x8000 and 0xc000 boot
regardless of the array.
Stupid question but have you ensured/checked that this array isn't optimized out?


That's PowerMac G3 "Blue and White".

--
Regards,
Pavel Roskin


_______________________________________________
Grub-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/grub-devel



--
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git

reply via email to

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