Re: [uClinux-dev] why no-mmu cannot support binfmt_aout.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/1/27 Jamie Lokier <jamie@xxxxxxxxxxxxx>:
> loody wrote:
>> BTW, I also find that if I want uclinux kernel to support ELF binary
>> file, I also have to enable the mmu option.
>> But the format of cross-compiled binary file like busybox is only ELF,
>> if there is option I can add to let  busybox and other binary files
>> compiled in different format.
>
> On uClinux with no MMU, you have to use FLT format (all architectures
> support this I think) or FDPIC-ELF (just a few architectures support
> this, the advantage is proper shared libraries and loadable modules).
>
> To make FLT files, usually you add "-Wl,-elf2flt=-s32768" or something
> like that to the GCC command line.  That option sets the stack size;
> the size needed is different for each application.  Too small and the
> app will crash or worse, corrupt memory.  Too large and it'll use a
> lot of memory, and won't start at all after the system has developed
> memory fragmentation.  Enjoy :-)
>
> -- Jamie

Hi:
thanks for your kind help.
After reading your replies, I googled the elf2flt and also try the
options you suggest to me.
But I find some problem while transferring the ELF to FLT.

1. I see there is a tool called, arm-linux-elf2flt. I try to use it to
transfer my busybux as FLT format, but it complains
"busybox: Input file contains no relocation info"
so I googled the
net,http://arc-linux.org/pipermail/arc-linux-dev/2006-December/000250.html,
 and guess maybe the elf2flt.ld is the relocation it needed.
but it still complain:
"File is not an object file"
so, it seems I have to make a object relocation file to let this tool,
arm-linux-elf2flt, work.
but how?

2. I use "-Wl,-elf2flt=-s1024" with arm-linux-gcc and it says:

/media/sda6/uclinux/usr/local/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld.real:
address 0x53880 of a.out.gdb section .text is not within region
flatmem
/media/sda6/uclinux/usr/local/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld.real:
error: no memory region specified for loadable section
`__libc_freeres_fn'
collect2: ld returned 1 exit status

it seems the elf2flt.ld need some modification, if I guess correctly.

3. Do i use the wrong toolchain, since I use arm-linux instead of
arm-elf. If so, where I can download arm-elf toolchain as arm-linux
did on uclinux.org, except those obselete.
BTW, I have use build root to re-get the toolchain. But when I enable
elf2flt config. the compile will show the error message below:
 /media/sda6/uclinux/buildroot-2009.02-rc2/toolchain_build_arm/binutils-2.19-build/bfd/libbfd.a(compress.o):
In function `bfd_uncompress_section_contents':
/media/sda6/uclinux/buildroot-2009.02-rc2/toolchain_build_arm/binutils-2.19/bfd/compress.c:96:
undefined reference to `inflateInit_'
/media/sda6/uclinux/buildroot-2009.02-rc2/toolchain_build_arm/binutils-2.19/bfd/compress.c:103:
undefined reference to `inflate'
make: *** [elf2flt] Error 1

Have anyone pump to this problem before?
appreciate your help,
miloody

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux