How to redirect the loader to another directory ?

robert song
Fri May 14 01:46:00 GMT 2010

Thank you very much, Goswin.

> You would have to copy qemu and the required libs into the chroot and
> call qemu in there or setup binfmt-misc for arm. Chroot on its own won't
> work.

the required libs may conflict with the target file. Now I build a
static qemu-arm.

Host> cd qemu-0.12.3
Host> ./configure --target-list=arm-linux-user --static
Host> make
Host> sudo cp arm-linux-user/qemu-arm /target/bin/qemu-arm
Host> sudo cd /target
Host> sudo chroot . /bin/qemu-arm /bin/sh
Host> /bin/qemu-arm /bin/ls

Now, it can work.
Regarding to binfmt-misc, I don't know it.

> The other way I know would be to alter the linker script and recompile
> binaries to use /target/lib/... as their dynamic loader. But that is
> hardly practical.

Well, it's not a good idea.

Best Regards,

More information about the Binutils mailing list