avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Specifying crt*.o file


From: reinhard . jessich
Subject: Re: [avr-gcc-list] Specifying crt*.o file
Date: Wed, 9 Jan 2002 22:27:09 +0100

On Wed, 09 Jan 2002, Anton Erasmus wrote:
> Hi,
> 
> If I specify the crt file explicittely on the command line, I get 
> "Duplicate Symbol" errors. It seems that the default crt file is still 
> linked in as well. I cannot find the option, that tells gcc not to link 
> in the default crt file.
> 
> The -nostartfiles option that reinhard jessich suggested, gives the 
> warning "unknown option nostartfiles". 

First I do only compile:
/usr/local/cross-tools/bin/avr-gcc -v -c test.c
nothing special in the output, so I will not send it.

The output of a normal link command:
/usr/local/cross-tools/bin/avr-gcc -v test.o
Reading specs from /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/specs
Configured with: /opt/avr/gcc/source/gcc-3.0.2/configure -v --target=avr 
--prefix=/usr/local/cross-tools --with-gnu-ld --with-gnu-as --disable-nls
Thread model: single gcc version 3.0.2
 /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/bin/ld
-m avr85xx
/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib/crts8515.o
-L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2
-L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib test.o -lgcc
-lc -lgcc                                

The output of the special link command:
 /usr/local/cross-tools/bin/avr-gcc -v -nostartfiles test.o
Reading specs from /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/specs
Configured with: /opt/avr/gcc/source/gcc-3.0.2/configure -v --target=avr
--prefix=/usr/local/cross-tools --with-gnu-ld --with-gnu-as --disable-nls
Thread model: single gcc version 3.0.2
/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/bin/ld -m avr85xx
-L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2
-L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib test.o -lgcc
-lc -lgcc

Then I have tried:
/usr/local/cross-tools/bin/avr-gcc -v test.o
/usr/local/cross-tools/avr/lib/crts8515.o

and got:
<snip>
/usr/local/cross-tools/avr/lib/crts8515.o: In function `__c_startup__':
/opt/avr/gcc/source/avr-libc-20020106/libc/gcrt1.S:148: multiple definition of
`_real_init_'
<snip>

Then I tried:
/usr/local/cross-tools/bin/avr-gcc -nostartfiles -v test.o
/usr/local/cross-tools/avr/lib/crts8515.o

and got:
<snip>
 /usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/bin/ld -m avr85xx
-L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2
-L/usr/local/cross-tools/lib/gcc-lib/avr/3.0.2/../../../../avr/lib test.o
/usr/local/cross-tools/avr/lib/crts8515.o -lgcc -lc -lgcc

So you can see the option is understand and the gcc will do exactly what I told
it. I have tested your special case with the crtxxx.o on the command line and
it worked, too!

Check the gcc command that you are using. Maybe you have forgot to add
something or maybe you have an other version of the compiler?

Reinhard

-- 
 Ing. Reinhard Jessich              mailto: address@hidden
 A-1190 Vienna, Goergengasse 2/2/1  phone: +43/1/3692600
 http://members.telering.at/jessich mobile: +43/664/1735439
avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]