about arm-linux-ld
walter harms
wharms at bfs.de
Wed Nov 23 15:35:27 UTC 2005
hi,
you are still mixing two things.
1. you are missing some .o files needed to generate a proper executable
use arm-gcc to link. he knows what to do. use arm-gcc -v to find out
how he is doing. do not make life harder than it is.
2. the busybox ml is related to busybox enhancements, bug fixed etc.
please start with simple programs to understand the building process
of gcc. busybox is much to complicated to try these kinds of stuff. use
hello.tar.gz or something like that.
3. my email to your personal address is blocked
re,
walter
蔡栋 wrote:
> Mike Frysinger,您好!
>>> arm-linux-ld: warning: cannot find entry symbol _start; defaulting to 00008558
>> which means it wont work at all
>>
>>> beacuse of I don't use crt0.o ,so the system output above message.but I can't find crt0.o in /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3 directory.
>> use crt1.o then
> yes,I know it's not busybox problem,and I think it's also not cross compile problem.because I use "arm-linux-gcc -O2 -o lock main.c lock_flash.c" to compile these file,it seems to work well!
>
> I'm sorry I write incorrect link command in previous letter, the link command is :
>
> "arm-linux-ld --start-group -L /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3/ -I /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3/include lock_flash.o main.o -lc --end-group -o lock"
>
> due to not use "crt0.o" ,so the system output "arm-linux-ld: warning: cannot find entry symbol _start; defaulting to 00008558" message
>
> becase of I find crt0.o in /opt/arm/lib/crt0.o,so I try to use
> "arm-linux-ld --start-group -L /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3/ -I /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3/include lock_flash.o main.o -lc /opt/arm/lib/crt0.o --end-group -o lock"
> then system didn't output any message,but the it't also can't working on busybox!
>
> then I try to use -lgcc instead of -lc option in arm-linux-ld ,ie:
> "arm-linux-ld --start-group -L /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3/ -I /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3/include lock_flash.o main.o -lgcc /opt/arm/lib/crt0.o --end-group -o lock"
> then system output:
> /opt/arm/lib/crt0.o: In function `_start':
> crt0.S:(.text+0x14): undefined reference to `__uClibc_main'
> crt0.S:(.text+0x18): undefined reference to `abort'
> lock_flash.o: In function `read_proc':
> lock_flash.c:(.text+0x30): undefined reference to `fopen'
> lock_flash.c:(.text+0x4c): undefined reference to `printf'
> lock_flash.c:(.text+0xbc): undefined reference to `__fgetc_unlocked'
> lock_flash.c:(.text+0xcc): undefined reference to `fgetc'
> lock_flash.c:(.text+0x150): undefined reference to `__fgetc_unlocked'
> lock_flash.c:(.text+0x160): undefined reference to `fgetc'
> lock_flash.c:(.text+0x184): undefined reference to `fseek'
> lock_flash.c:(.text+0x1b0): undefined reference to `fscanf'
> lock_flash.c:(.text+0x1e4): undefined reference to `printf'
> lock_flash.c:(.text+0x1f0): undefined reference to `strlen'
> lock_flash.c:(.text+0x208): undefined reference to `strncmp'
> lock_flash.o: In function `lock_partition':
> lock_flash.c:(.text+0x2f4): undefined reference to `malloc'
> lock_flash.c:(.text+0x320): undefined reference to `sprintf'
> lock_flash.c:(.text+0x330): undefined reference to `open'
> lock_flash.c:(.text+0x350): undefined reference to `printf'
> lock_flash.c:(.text+0x398): undefined reference to `ioctl'
> lock_flash.c:(.text+0x3ac): undefined reference to `printf'
> lock_flash.c:(.text+0x3b8): undefined reference to `close'
> lock_flash.c:(.text+0x3cc): undefined reference to `close'
> lock_flash.c:(.text+0x3d4): undefined reference to `free'
> lock_flash.o: In function `lock_flash':
> lock_flash.c:(.text+0x440): undefined reference to `printf'
> lock_flash.c:(.text+0x464): undefined reference to `printf'
> lock_flash.c:(.text+0x480): undefined reference to `printf'
> lock_flash.o: In function `handle_string':
> lock_flash.c:(.text+0x4cc): undefined reference to `strtol'
> main.o: In function `main':
> main.c:(.text+0x3c): undefined reference to `printf'
>
> obviously system can't find any symbol in library ,why? Could you tell me the difference between "lc" and "lgcc"?
>
> I just want to know how to use arm-linux-ld to link several object file into one executable obj.Could you give me some advise?
>
> Thanks!!
>
>
>
>
>
>
>
> ======= 2005-11-23 18:57:28 您在来信中写道:=======
>
>> On Wed, Nov 23, 2005 at 06:35:49PM +0800, ???? wrote:
>>> busybox????????
>> no, this is not a busybox issue, you should ask it on one of the arm
>> mailing lists:
>> http://www.arm.linux.org.uk/mailinglists/
>>
>>> arm-linux-gcc -o2 -c -o main.o main.c
>> -o2 is not valid, but -O2 is
>>
>>> arm-linux-ld: warning: cannot find entry symbol _start; defaulting to 00008558
>> which means it wont work at all
>>
>>> beacuse of I don't use crt0.o ,so the system output above message.but I can't find crt0.o in /opt/arm/lib/gcc/arm-linux-uclibc/3.4.3 directory.
>> use crt1.o then
>> -mike
>> _______________________________________________
>> busybox mailing list
>> busybox at busybox.net
>> http://busybox.net/cgi-bin/mailman/listinfo/busybox
>
> = = = = = = = = = = = = = = = = = = = =
>
>
> 致
> 礼!
>
>
> 蔡栋
> caidong at kedacom.com
> 2005-11-23
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
More information about the busybox
mailing list