On 7/31/06, Philipp Gühring <[EMAIL PROTECTED]> wrote: [32bit vs 64bit libraries]
Now I am wondering, whether it would be possible to integrate the processor emulator of qemu into the Linux kernel, so that applications can transparently use different-bitsized libraries by qemulating them on demand?
The problem is not running 32bit code, a 64bit kernel can do that perfectly fine (with the correct 32bit libraries). The problem is that 32bit and 64bit code has a different ABI. Basically, if you call a library function with an integer on the pointer, both are put on the stack. In the 32bit ABI, they are both 4 byte values, but in the 64bit ABI the pointer needs 8 bytes. So when you want to call 64bit libraries from 32bit code, you would need to convert the parameters on the stack, and for that you would need to know what the parameters are. However, the library and the code have no information on this, because it is only in the source code, not in the binary. There are more problems (address space, different register allocation etc), but the function call sequence is the main problem. And qemu cannot solve it. Thomas _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel