From: Paul M. <le...@li...> - 2003-01-06 19:58:45
|
On Sun, 2003-01-05 at 20:34, David McCullough wrote: > I suspect that you are still running ELF programs. When you turn off the > MMU support in the kernel, the rules for applications change a little. > They cannot be paged in for example, and they have to be loaded (and > relocated) at run time. Normal elf programs are loaded at a fixed > addresses and this cannot work without an MMU. > > The uClinux guys use a program called elf2flt (ELF to flat) to make flat > binaries that can be run without an MMU. You can find it at: > Okay, one issue with elf2flt. I've built a static busybox linked against uClibc (which was built w/o HAS_MMU set), also using the sh-uclibc- toolchain (which is also built w/o HAS_MMU). Now, this busybox itself doesn't have any relocations in it, though it's still an ELF. elf2flt currently bails and refuses to write the flt hdr/file if it sees that the ELF doesn't have anything needing relocation. This happens around line 900 of elf2flt.c from current HEAD by way of the bfd_get_file_flags() HAS_RELOC check. If I comment this out, the flt file is generated properly. This brings up the question, if I have an ELF that was built with PIC turned off, can binfmt_elf deal with it? or does it still have to pass through binfmt_flat? > http://cvs.uclinux.org/cgi-bin/cvsweb/elf2flt/ > > I don't believe there is SH support in it at the moment, but it isn't a > huge amount of work. Generally only a few relocation types need to be > handled, Currently I have R_SH_DIR32, R_SH_REL32, R_SH_GOT32 and R_SH_GOTPC supported. I'll submit patches for this once the above mess is worked out. Regards, -- Paul Mundt <le...@li...> |