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: Anton Erasmus
Subject: Re: [avr-gcc-list] Specifying crt*.o file
Date: Thu, 10 Jan 2002 10:30:12 +0200

Matt,

Thanks for your reply. I will try both your and reinhards' 
suggestions. I will see which one will be the easiest to add to the 
Volker Oth make files.

In case anyone was wondering why I want to use my own crt file.

I am using the avr-gcc compiler version without explicit support for 
the ATMega128 to generate code for the ATMega128.
I am specifying the MCU as avr5, and adding the -
D__AVR_ATmega128__ option to the command line.
I have assembled the gcrt1.s file with the same option enabled to 
generate a suitable crt file for the ATMega128. I have also edited 
the ATMega103 linker script file to generate a suitable linker file for 
the ATMega128. Some changes to the inp and outp macros in the 
iomacros.h file was also neccesary.

Regards
   Anton


Date sent:              Thu, 10 Jan 2002 08:21:39 +1100
From:                   Matthew Lee <address@hidden>
Organization:           Smart Container
To:                     Anton Erasmus <address@hidden>
Copies to:              address@hidden
Subject:                Re: [avr-gcc-list] Specifying crt*.o file

> Anton,
> 
> As far as I remember, if you compile and link in one step (with
> avr-gcc), it will automatically include crt*.o at the linking stage. 
> If you've specified crt*.o on the gcc command line as well, it will
> attempt to link it twice (and thus the duplicate symbol error you are
> seeing).
> 
> If you don't do the linking step with avr-gcc but with avr-ld, then
> you can specify the crt*.o file on the linker command line (as Scott
> suggested below) and you shouldn't get your duplicate symbol problem.
> 
> Regards,
> Matt
> 
> 
> 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".
> > 
> > For the moment I have edited the specs file to change the name of
> > the default crt file, but this is a complete hack.
> > 
> > Regards
> >    Anton
> > 
> > > Hello Anton,
> > >
> > > Just specify the crt*.o file on the linker command line. The
> > > important thing to remember is to PUT IT FIRST (ie before any
> > > other .o files). This will ensure (I only say this from
> > > experience) that the contents are put at address zero.
> > >
> > > Regards,
> > >
> > > Scott
> > >
> > > Anton Erasmus wrote:
> > > >
> > > > Hi,
> > > >
> > > > I am trying to use a custom start-up file with avr-gcc. How does
> > > > one force the linker to link with a specified crt file in stead
> > > > of the default crt*.o file ?
> > > >
> > > > Regards
> > > >    Anton
> > > >
> > > > avr-gcc-list at http://avr1.org
> > > avr-gcc-list at http://avr1.org
> > >
> > 
> > avr-gcc-list at http://avr1.org
> avr-gcc-list at http://avr1.org
> 


avr-gcc-list at http://avr1.org



reply via email to

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