loody wrote:
> When I use "-Wl,-elf2flt,-s32768" to compile my hellow.c.

It should say "-wL,-elf2flt=-s32768".  Note the "=" (equal sign).

> b.
> When I use "-Wl,-elf2flt" to compile my hellow.c.
> it will say:
> arm-linux-uclibcgnueabi/bin/ld.real: error: no memory region specified
> for loadable section `.plt'
> collect2: ld returned 1 exit status

Something's wrong with the GCC options or with libc.
There should be no no ".plt" section when compiling for ARM-nommu.

Use "readelf -hledS hello.elf" (whatever ".elf" file is created by
GCC) to see what sections it has.  For your ARM type, it should not
have ".plt" or ".got".

If it's wrong, you can use "-v" with GCC (and all the other options)
to see how it's linking.  That might give a clue.

> c.
> so I try to use arm-linux-uclibcgnueabi-elf2flt to meet my requirement.
> And it say:
> TEXT -> vma=0x0 len=0x24
> DATA -> vma=0x0 len=0xc
> ERROR: text=0x24 overlaps data=0x0 ?

Are you running that on a linked ELF _executable_ (a.out) or an ELF
object file (*.o)?  Looks like a *.o to me.

> it seems i need to modify some file to fix b and c. But I cannot find
> any config about elf2flt.

You should never run elf2flt yourself.  Always let GCC do it.

> And it seems ALMOST work.
> 
> ALMOST means I can see the kernel message says
> "tart_thread(regs=0x83c15ef8, entry=0x83d60044,
> start_stack=0x83d6ffb0)"
> but I cannot see the "hello" that I am looking for.

To some extent, the toolchain's uClibc must match the kernel you're
using, too.

> 1. I guess the reason why I cannot see the "hello" from console is due
> to some lib I have to put at root file system/lib. But I don't know is
> there any tool like readelf can tell me what lib flt needs? I only can
> do is use "file". But it only can tell me the format not the detail
> information. If someone knows any tool for flt, please let me know.

You can use "readelf" on the "a.out.elf" or "hello.elf" file that's
created by GCC.  When compiling with "-Wl,elf2flt=-s32768", you get
_two_ output files.  One's a flat executable which you run, and the
other ends with ".elf".  You can run tools like "readelf" and "nm" and
"nm --dynamic" on the ELF file.

> BTW, is my hello.c too complicate that it fail to print message on console?
> #include <stdio.h>
> int main()
> {
>         printf("Hello World");
>         return 0;
> }

It's fine.

-- Jamie
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to