This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3 regression?] flag_hosted and back-ends
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Jason R Thorpe <thorpej at wasabisystems dot com>
- Cc: Geoff Keating <geoffk at geoffk dot org>, gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Sat, 15 Mar 2003 13:27:17 +0000
- Subject: Re: [3.3 regression?] flag_hosted and back-ends
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> On Fri, Mar 14, 2003 at 03:54:18PM -0800, Geoff Keating wrote:
>
> > Why can't GRUB supply its own __enable_execute_stack function, that
> > does whatever the right thing is for GRUB's environment?
>
> I can see a couple of reasons why that would not be appropriate:
>
> * Random applications should not have to know about internal
> routines in libgcc.
>
> * An application that uses -ffreestanding has pretty much
> told the compiler "don't assume I'm in a hosted environment".
> The __enable_execute_stack() function *does* assume a hosted
> environment. It seems perfectly logical that it should not
> be used if the application is free-standing.
__enable_execute_stack should only be needed if the address of the nested
function is taken. Otherwise, nested functions just give closures and
shouldn't pose a problem. However, that's not the only function needed on
some platforms if you take the address of a nested function: you also need
calls to synchronize the caches if you have a Harvard cache architecture.
My inclination would be to say that taking the address of a nested
function should only be supported in a hosted environment, since it
requires OS support.
R.