grub-devel
[Top][All Lists]
Advanced

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

Re: PPC64 mlongcall gcc flag


From: Hollis Blanchard
Subject: Re: PPC64 mlongcall gcc flag
Date: Wed, 05 Nov 2008 11:25:15 -0600

On Tue, 2008-11-04 at 18:48 -0500, Pavel Roskin wrote:
> 
> However, it would be nice to have a better explanation why "-mlongcall"
> is needed.  If it's only needed for modules and has significant
> overhead, we may want to introduce MODULE_CFLAGS, which would only be
> used for modules.

It absolutely should only be used for modules.

It's needed because a PowerPC branch instruction can only target +/-
32MB. -mlongcall replaces the direct branch with an indirect one (using
mtctr/bctrl instructions). This can target the full 32-bit address
space.

> By the way, I tried cross-compiling for PowerPC with and without
> "-mlongcall" with gcc 4.2.4.  With "-mlongcall", the size of all modules
> combined is 426424 bytes.  Without "-mlongcall", the size of all modules
> combined is 354464 bytes.  That's a significant difference for a
> bootloader and should be avoided if possible.

To be fair, if we are that worried about footprint, why do we have a
runtime ELF linker in a bootloader?

At any rate, the point of having dynamically loadable modules is so you
can only load the ones you need. On that scale I think the size increase
is less of an issue.

> Maybe there is a way to keep the modules and the core in the first 32
> megabytes?

Actually I'm confused about something here Manoel.

Module memory is allocated by grub_malloc(), but as you can see at
http://svn.savannah.gnu.org/viewvc/trunk/grub2/kern/ieee1275/init.c?revision=1806&root=grub&view=markup
 the GRUB heap capped at 4MB (I don't mean size, I mean the end of the heap). 
So how are your modules appearing in memory above 32MB?

-- 
Hollis Blanchard
IBM Linux Technology Center





reply via email to

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