This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3 regression?] flag_hosted and back-ends


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]