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

GNAT, executable stack and trampolines (was: Next version of libtemplates-parser in Debian)



Reto Buerki wrote:
> On 05/24/2011 11:00 AM, Pascal Obry wrote:
>> ... but as you found out some work as been done to remove most cases
>> where a stack must be executable.
> 
> Yes. But as it seems this work has not (yet) been merged into FSF gcc.
> 
> I'm looking into FSF gcc trunk right now to find out if the following
> work found in the GNAT GPL 2010 compiler (file: src/gcc-43.dif) has been
> merged:
> 
> 2008-05-25  Eric Botcazou  <ebotcazou@adacore.com>
>    Elimination of stack trampolines
>    ...[snip]...
> 
> Part of this huge patch introduces the -fno-trampolines compiler option:
> 
> "-fno-trampolines is enabled by default to let the compiler avoid
> generating them if it computes that this is safe, on a case by case
> basis, and replace them with descriptors.  Descriptors are always made
> up of data only, but the generated code must be prepared to deal with
> them."
> 
> This option does not exist in gcc (Debian 4.4.5-8) 4.4.5:
> gnat1: error: unrecognized command line option "-fno-trampolines"
> 
> It works (as expected) with GNAT GPL 2010. If you specify -ftrampolines,
> the stack is set executable as well.
> 
> @xavier: Can you test if such an option exists in gcc 4.6.0?

I don't see this patch in
http://gcc.gnu.org/ml/gcc-patches/2008-05/authors.html or in the ChangeLog
in the FSF tree.  The option -fno-trampolines does not appear in the index
of the GNAT User's Guide for GCC 4.6.0. Therefore it seems like someone at
AdaCore decided not to (or forgot to) merge this patch into the FSF tree :(

I'll try to find out whether any other patches are missing.  This might
take me several days though.  If anyone wants to help with this search,
could you compare the gcc/ada/ChangeLog-2008 of GNAT GPL 2010 with that of
GCC 4.6.0 and send me the diff?  Same for all other gcc/ada/ChangeLog-*
files, for that matter.

-- 
Ludovic Brenta.


Reply to: