Executable memory: some apps that work on RH9 don't on FC1

Neal D. Becker nbecker at hns.com
Mon Nov 17 13:08:41 UTC 2003


On Monday 17 November 2003 08:03, Jakub Jelinek wrote:
> On Mon, Nov 17, 2003 at 01:54:55PM +0100, Gerard Milmeister wrote:
> > Some software, among them clisp, scm and mit-scheme don't work anymore
> > with FC1. One problem seems to be that on FC1 stack and malloced memory
> > is no longer executable, at least not without using mprotect.
> > Interpreters and compilers like the above commonly allocate a piece of
> > memory and fill it with executable code. I am sure they can be adapted
> > to work on FC1, but I would have preferred that the FC1 kernel would
> > behave in the same way as the RH9 one. Is there any way to disable this
> > behaviour. Trying to get the problem fixed by the upstream developers
> > will probably take a long time, and it seems that other Linux distros
> > don't show this problem...
>
> If they need executable stack in a way which is not known to the compiler,
> the programmer has to tell it to the toolchain.
> If a program say takes address of a nested function, GCC knows it needs
> executable stack and arranges things automatically.
> Otherwise, either an object file can be marked as needing executable
> stack (with -Wa,--execstack; at least one such object will make the whole
> shared library or binary requiring executable stack), or during link
> time with -Wl,-z,execstack or after it using execstack(8) utility.
> The defaults are such that programs and/or libraries compiled/linked
> on <= RHL9 are always assumed to potentially require executable stack,
> but if you build a new program on FC1, you really need to tell the
> toolchain about it.
>

Is it possible to mark executables, without requiring relinking?





More information about the fedora-test-list mailing list