comp.lang.ada
 help / color / mirror / Atom feed
From: Tero Koskinen <tero.koskinen@iki.fi>
Subject: Re: LLVM--Low Level Virtual Machine--and Ada
Date: Sat, 21 Jul 2007 16:09:40 +0300
Date: 2007-07-21T16:09:40+03:00	[thread overview]
Message-ID: <20070721160940.56433a45.tero.koskinen@iki.fi> (raw)
In-Reply-To: wccvecfb25a.fsf@shell01.TheWorld.com

On Fri, 20 Jul 2007 10:06:25 -0400 Robert A Duff wrote:
> Another problem is that some modern machines use DEP (which I think
> stands for "data execution prevention" or something like that).  DEP
> means the operating system prevents writeable data from being executed
> as code.

For example, OpenBSD people call this technique W^X (write xor execute).
It is enabled on sparc{,64}, alpha, i386, amd64, and hppa architectures.

> But DEP prevents trampolines from working, so users have to turn
> it off in order to run some Ada programs (such as the compiler).
> It's a pain because users get some mysterious error message
> when trampolines are used.

Presentation slide(s) at
http://www.openbsd.org/papers/ven05-deraadt/mgp00012.html
tells how OpenBSD handles trampolines and non-executable stack.

In addition, OpenBSD's gcc-local(1) manual page says:
- On most architectures, trampoline code marks the smallest possible
  area around the trampoline stub executable using mprotect(2), since
  the stack area is by default non-executable.

I don't personally know all the technical details, but above
information would suggest that it is somehow possible to
use trampolines and DEP/W^X together.

From user viewpoint everything "just works". I can compile
(almost) vanilla gcc 4.2 with Ada support on OpenBSD and then
use it to compile normal Ada code. The operating system and
the compiler(s) handle the memory protection details behind
the curtains and I don't need to worry about it.
No pain involved. :)

-- 
Tero Koskinen - http://iki.fi/tero.koskinen/



  reply	other threads:[~2007-07-21 13:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18  3:56 LLVM--Low Level Virtual Machine--and Ada Jerry
2007-07-18  7:24 ` Georg Bauhaus
2007-07-18  7:48 ` Duncan Sands
2007-07-19 14:30   ` Maxim Reznik
2007-07-19 14:56     ` Duncan Sands
     [not found]     ` <200707191656.27602.baldrick@free.fr>
2007-07-19 15:03       ` Duncan Sands
2007-07-19 21:30         ` Robert A Duff
2007-07-20  7:44           ` Duncan Sands
2007-07-20 14:06             ` Robert A Duff
2007-07-21 13:09               ` Tero Koskinen [this message]
2007-07-23  7:47               ` Duncan Sands
2007-07-24  2:12                 ` Randy Brukardt
2007-07-24  8:03                   ` Duncan Sands
2007-07-24  9:50                     ` Colin Paul Gloster
2007-07-24 10:47                       ` Markus E Leypold
2007-07-25 12:12                         ` Colin Paul Gloster
2007-07-25 12:59                           ` Markus E Leypold
2007-07-24 19:21                     ` Randy Brukardt
2007-07-24 19:36                       ` Duncan Sands
2007-07-24 19:58                         ` Randy Brukardt
2007-07-24 23:28                   ` Robert A Duff
2007-07-25  0:39                     ` Randy Brukardt
2007-07-25  2:00                       ` Robert A Duff
2007-07-25 13:14                         ` Duncan Sands
2007-07-21 22:04 ` anon
2007-07-22 13:22   ` Steve
2007-07-23 12:29   ` Colin Paul Gloster
2007-07-23 14:42     ` anon
2007-07-23 16:55       ` Markus E Leypold
2007-07-24 10:19       ` Colin Paul Gloster
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox