How to package execute-on-stack programs?

Michael K. Johnson johnsonm at redhat.com
Wed Sep 3 21:52:00 UTC 2003


On Thu, Aug 28, 2003 at 03:13:44PM +0200, Enrico Scholz wrote:
> A program suffering from this is qemu[1]; I tried the chstk tool[2], but
> it fails with

That's from an earlier way of marking.  There's now a different way
of doing it.  I don't think that new way is yet supported in the
kernel that we shipped, but I may misremember...  The latest kernel
in RHN (and tomorrow in rawhide) has the latest exec-shield in it.

If you build something with gas directly, you can pass the
--execstack option to gas; otherwise, use the compiler argument
-Wa,--execstack to tell the compiler to tell gas to request
an executable stack.

Alternatively, if you have assembler sources, you can also add
.section .note.GNU-stack,"x"; .previous
to the assembler source; that's what the --execstack option does.

How that needs to be factored into qemu building I don't know;
as you point out, that may be a bit complex...

michaelkjohnson

 "He that composes himself is wiser than he that composes a book."
 Linux Application Development                     -- Ben Franklin
 http://people.redhat.com/johnsonm/lad/





More information about the fedora-devel-list mailing list