From: Jim W. <jw...@dr...> - 2011-02-03 22:33:15
|
Peter Keller <ps...@cs...> writes: > On Thu, Feb 03, 2011 at 12:28:35PM -0500, Michael J. Barillier wrote: >> I've been curious about how the SBCL compiler works (but not enough to >> code-dive). Docs say that SBCL compiles to native code, and >> disassembling a function shows native instructions, but how does SBCL >> load that into an executable area of memory? Intel processors and >> others don't allow execution of memory segments (as I recall from >> assembly hacking in a previous life), so how does SBCL generate a stream >> of machine instructions and call the entry point? > > Under unix, the system level calls of mmap() and mprotect() are your > friends.... ... and it's worth noting that ld.so / rtld, the shared library loader, is itself a user-space program whose source is often available for comparison. -- Jim Wise jw...@dr... |