Re: Proposal "LUID"

From: Florian Weimer (fw@deneb.cygnus.argh.org)
Date: Wed Apr 19 2000 - 12:11:19 EST


Jesse Pollard <pollard@tomcat.admin.navo.hpc.mil> writes:

> > It's true that Ada implementations can use obscure techniques to avoid
> > trampolines for nested subprograms. But the GNU Ada Translator uses
> > trampolines (actually, it's a feature of the backend, and you can use
> > GCC trampolines with most frontends, including the C frontend).
>
> I don't consider a frame pointer + function address pointer to be
> "obscure".

IIRC you can't implement the Ada semantics this way unless all
access-to-subprogram values have the form "frame pointer + code
address". But most targets have already established different
semantics for function pointers, and interfacing to other languages
becomes painful if you don't follow such conventions.

> This has been standard programming for quite some time. The GNU backend
> is what generates this artifact, but Ada works quite well on systems that
> don't even have a hardware stack.

I think GCC as well. ;) IMHO, trampolines are a good thing because
they are the only way to ensure ABI compatibility.

> > Last time I checked, the non-executable stack patch detected properly
> > gcc 2.8.x trampolines, but not those generated by GCC 2.95.2.
> >
> > Anyway, it's slightly amusing that a kernel patch which aims for
> > improved security may eventually stop Ada programs from running.
>
> That part is normal - I don't think the gnu Ada has passed the full
> test suite

This is wrong. AFAIK, there is no Ada compiler on the market which
hasn't been validated for at least some targets. The Ada community
considers conformity to the Ada standard essential, at least it's more
important for them than for some other language communities. (If you
think that Ada programmers have very twisted minds if they adhere to
crockish standard: Contrary to popular belief, Ada is well-designed,
and the standard is rather readable as well.)

GNAT is, of course, no exception when it comes to validation tests.
The detailed report is available on the web, an ACT press release can
be found here:

http://www.gnat.com/texts/news/product_updates/prod_validation.htm

> (I think -my opinion- that is why it is "gnat" and not Ada).

Interesting comment. ;)

> Since Ada was supposed to (was dropped) run in embeded systems with
> minimal stack, it should not put functions on the stack (takes too
> much space). Now this doesn't hurt in a general manner, but it does
> impose (some) software limits on what can be done with it.

If you are targetting an environment with extreme space constraints,
you have to restrict yourself to a subset of the language anyway.
Note, a trampoline is not needed for every nested subprograms, only
for those which reference variables in the enclosing subprogram (and
if you take the address of the nested subprogram, of course).

I think this is rapidly drifting off-topic, so here's my main point:
If trampolines are considered evil, this should be clearly stated
long before supported for them is finally removed so that people who
currently rely on them can try to find workarounds in time.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:15 EST