Hypervisors and you!

Michael Torrie torriem at gmail.com
Sat Mar 30 09:51:20 MDT 2013


On 03/30/2013 12:45 AM, Dan Egli wrote:
> That's interesting. How did you differentiate them from the PPC libs? I
> know most binaries look for the library by file name in each directory in
> your library path (either from the LD_LIBRARY_PATH environment variable, or
> those directories specified in /etc/ld.so.conf) and load the first matching
> filename. So how did your Qemu know to run say /lib-x86/libc.so instead of
> /lib/libc.so? Did you have some kind of funky ld.so magic? Or was there a
> Qemu parameter that specified a lib directory for those files?

I believe a mini root file system was placed in a directory somewhere,
like /usr/qemu/architecture.

Note this idea is similar to how debian does multi-arch (32-bit on
64-bit), and in fact using a transparent emulator like qemu's user
emulation system is one of the reasons stated why Debian and Ubuntu
chose not to follow the LSB standard of using /usr/lib64 on 64-bit
systems to accommodate multiarch.  So presumably on these distros you'd
follow multiarch conventions for installing the arm or ppc libraries.

As for binary loading, it is all in the elf binaries and kernel custom
loader (/usr/lib/binfmt.d/ on Fedora defines these), as Nicholas said.
The same binfmt mechanism can also transparently load and run windows
binaries in wine, though for security reasons it's not recommended, and
not enabled by default on most distros that I know of.


More information about the PLUG mailing list