[uClibc]"undefined reference __gccmain" problem fixed, but.....

David McCullough davidm at snapgear.com
Thu Jun 26 07:30:09 UTC 2003


Jivin Eric lays it down ...
> Dear all,
> 
> I've just fixed the error message "undefined reference __gccmain" problem by
> adding '/usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a'. However, there is a
> new problem arrived. Here is the error message:
> 
> arm-elf-ld -nostdlib -T ld.dsc24.ForUpGrade.script  rrload_base.o
> sdram_dsc24.o ether_cs8900.o flash_toshiba.o io_dsc21.o osd_dsc24.o  -o
> rrload.ForUpGrade '/usr/local/arm-elf/lib/libc.a'
> '/usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a'
> /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o): In function
> `__do_global_ctors':
> __main.o(.text+0xbc): undefined reference to `atexit'
> __main.o(.text+0xc4): undefined reference to `__CTOR_LIST__'
> /usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o)(.data+0x0):
> undefined reference to `__DTOR_LIST__'

You need to add the -Wl,-elf2flt option to the link line so that you
get a flat file to run.  This is due to the elf2flt process and should
be fixed in the next tools release if I get to it :-)

Cheers,
Davidm

-- 
David McCullough, davidm at snapgear.com  Ph:+61 7 34352815 http://www.SnapGear.com
Custom Embedded Solutions + Security   Fx:+61 7 38913630 http://www.uCdot.org


More information about the uClibc mailing list