[Aboriginal] elf header help

Rob Landley rob at landley.net
Fri Mar 23 15:43:08 PDT 2012


On 03/23/2012 02:13 AM, wangji wrote:
> dear oldpal FirmwareLinux !
> 
> I have always been intrigued by the ELF header ,without never been able
> to clarify myself for understanding !

The best conceptual introduction to ELF headers is:

http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html

> To be concise : 
> using mipsel_rootfs from 
> 1 openwrt (a.k.a kamikaze 7/8.x mipsel)
> 2 firmwareLinux_mipsel_rootfs (old one 2009,but I guess won't change
> with more recent version)
> 
> I can only use qemu-mipsel-static from_ubuntu_nattty_10.04/10 to
> recognise FirmwareLinux_busybox

Have you tried the busybox binaries I put on
http://busybox.net/downloads/binaries/latest

There should be a mipsel one there...

> But for openwrt_kamikaze_mipsel I need my own qemu-mipsel-static ,
> -I don't remember how I got it (either I had compiled it or I had from 
> google on some Portuguese site -people working on Nokia's embedded
> stuffs )
> Could you give me a guide line how to examine this problem 

*shrug*  I use system images with system emulation, not chroots with
application emulation.  I haven't played with this recently.  Presumably
current versions work, most likely your dynamic linker path's getting
misinterpreted.

> Here how I tested different cases :
> I just copy qemu-mipsel-static into mipsel_rootfs/usr/bin/
> then from my ubuntu's_inside_that_mipsel_rootfs :
> 
> chroot . /bin/busybox 
> 
> to run mips_busybox locally.

I submitted a patch to get qemu to do its own chroot long ago:

http://www.mail-archive.com/qemu-devel@nongnu.org/msg16297.html

I believe it got merged.  You need to do the chroot before you exec a
binary in order to get the dynamic linker path to be out of the new
chroot (since it's an absolute path), but you need to run qemu in order
to run the mips binary, which implies an x86 qemu binary has to be _in_
the (otherwise mips) chroot...

> (my ubuntu had binfmt-support + qemu_installed from synaptic_ubuntu by
> default)
> thanks

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

 1332542588.0


More information about the Aboriginal mailing list