Date: Sun, 27 Oct 2002 10:07:39 -0800 (PST) From: John Polstra <jdp@polstra.com> To: sparc@freebsd.org Cc: jake@locore.ca Subject: Re: Is the sparc64 stack segment executable? Message-ID: <200210271807.g9RI7dZC046984@vashon.polstra.com> In-Reply-To: <20021026224039.F89245@locore.ca> References: <XFMail.20021026151445.jdp@polstra.com> <200210262328.g9QNSrkn045622@vashon.polstra.com> <20021026224039.F89245@locore.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <20021026224039.F89245@locore.ca>, Jake Burkholder <jake@locore.ca> wrote: > > > Next question: Assuming the stack is not executable by default, would > > > it work for the application to make it executable using mprotect? > > > > Yes. > > Gcc is not generating the calls to mprotect. Its a simple fix, Yes, I saw the stuff in sol2.h that takes care of it. It sure is ugly, though. Every time you pass the address of a nested function, you have to make a system call. I suppose there must be some good reason why the stack isn't executable by default ... right? > I'll try to get it committed and get gcc on panther upgraded as > soon as I can. Thanks, but there's no rush (see below). To fix it were you just going to copy the definition of TRANSFER_FROM_TRAMPOLINE from <config/sparc/sol2.h> into <config/sparc/freebsd.h>? It would be good to fix it in gcc eventually, but don't rush to do it on my behalf. Modula-3 uses its own version of the gcc sources for its code generator, so fixing the system gcc won't make any difference there. I guess I can put the fix into the Modula-3 version to get it working -- or I can use a different approach. The original M3 code generator avoided the trampolines altogether, but that involved patching more of gcc. Up until now, I've managed to get by with simply adding new files to gcc-3.2. I haven't had to patch any of the stock source files. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210271807.g9RI7dZC046984>