Can you enter x64 32-bit “long compatibility sub-mode” outside of kernel mode?
This might be an exact duplicate of Is it possible to execute 32-bit code in 64-bit process by doing mode-switching? , but that question is from a year ago and only has one answer that doesn't give any source code. I'm hoping for more detailed answers. I'm running 64-bit Linux (Ubuntu 12.04, if it matters). Here's some code that allocates a page, writes some 64-bit code into it, and executes that code. #include <assert.h> #include <malloc.h> #include <stdio.h> #include <sys/mman.h> // mprotect #include <unistd.h> // sysconf unsigned char test_function[] = { 0xC3 }; // RET int main() { int