Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 2002 10:53:12 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        sparc@freebsd.org
Cc:        jake@locore.ca
Subject:   Re: Is the sparc64 stack segment executable?
Message-ID:  <200210271853.g9RIrC7u047147@vashon.polstra.com>
In-Reply-To: <20021027134726.J89245@locore.ca>
References:  <XFMail.20021026151445.jdp@polstra.com> <20021026224039.F89245@locore.ca> <200210271807.g9RI7dZC046984@vashon.polstra.com> <20021027134726.J89245@locore.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <20021027134726.J89245@locore.ca>,
Jake Burkholder  <jake@locore.ca> wrote:
> Apparently, On Sun, Oct 27, 2002 at 10:07:39AM -0800,
> 	John Polstra said words to the effect of;
> > I suppose there must be some good reason why the stack isn't
> > executable by default ... right?
> 
> There are a couple reasons, I don't know how good they are.
[...]

Thanks for the detailed explanation!

> The idea is that code that does this is in the minority so overall its
> a win.  The code that gcc generates can be made to do a sysctl or something
> on startup, so the stack protections could be made a tunable to avoid
> the system calls if its not confgured that way.
> 
> Does modula-3 do this a lot?

It's used in a few places in the compiler code, but I don't have a
feel for how frequently those places are executed.  I don't use nested
functions much at all in my own code.  They don't buy you much except
the avoidance of a little parameter passing.

> > Thanks, but there's no rush (see below).  To fix it were you just
> > going to copy the definition of TRANSFER_FROM_TRAMPOLINE from
> > <config/sparc/sol2.h> into <config/sparc/freebsd.h>?
> 
> Yes.  This works, I've built a compiler that does this and your test
> program runs.

OK ...  

Actually, it would be nice if you could get panther upgraded with this
fix.  Then the necessary function (__enable_execute_stack) would be
present in libgcc for the Modula-3 compiler to use.

Thanks,
John
-- 
  John Polstra
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "Disappointment is a good sign of basic intelligence."  -- Chögyam Trungpa


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-sparc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210271853.g9RIrC7u047147>