From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fee84,19b734d6714b1966,start X-Google-Attributes: gidfee84,public From: lovegirl@mail.freenet.hut.fi (Sonia Ivanova,Varna Bulgaria) Subject: stack non-executable on osf/1? Date: 1997/11/27 Message-ID: <65k1pf$jgk$1@learnet.freenet.hut.fi>#1/1 X-Deja-AN: 293163052 Organization: Freenet Finland Newsgroups: comp.unix.osf.osf1 Hi, anyone here has any idea whether OSF/1 can execute code on the stack, and if so, how? i wrote the following simple piece of code to test that: main() � int x = 0x47ff041f; /* nop */ void (*f) () = (void *) &x; f(); � when that is run, it gets a SIGSEGV when executing the 'nop' instruction. while, if x was declared 'static', it gets a SIGSEGV when executing the instruction following the nop (this can be verified by examining the coredump). from that i'd say that the data segment is executable, while the stack segment isn't. however, according to the DEC OSF/1 Assembly Language Programmer's Guide, both the stack and the data segments are supposed to be executable. so i thought i might be doing something wrong. if anyone has any ideas about this, please let me know. sonia