[Top][All Lists]

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

Re: [avr-gcc-list] How to link without .init4 ?

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] How to link without .init4 ?
Date: Tue, 23 Aug 2005 20:40:07 +0200 (MET DST)

Bernard Fouché <address@hidden> wrote:

>>So for the ATmega103 and ATmega128, you'll always drag in that
>>version as part of the startup files. :-(

> Can't this 'big code' __do_copy_data() be renamed to
> __big_code_copy_data() and be stored also in libgcc.a ? So one can
> provide its own also?

Not so easily (otherwise Marek probably wouldn't have chosen that
approach).  As you know, right now, the compiler itself has no notion
about the target's ROM (and RAM) size, it only knows about a rough
classification into these five AVR `models' named internally avr1
through avr5.  As the requirement for calling the `big code' versions
only arises for the ATmega103 and ATmega128, the compiler cannot
really decide that (except by hard-coding these two processor types,
but that would it make even more ugly).  Right now, the only file that
really knows about each individual MCU type is the startup code file,
gcrt1.S.  That's why the `big code' versions have been moved there.

As we eventually intend to ship a finer-grained library model some
day, where the MCU-independent code still goes into one libc.a per
`model', but each device can have its own sub-library, this would be a
good chance to move the initialization functions into these

Also, the original intention of these init functions has been that the
compiler can request them on-demand, so you wouldn't need to manually
move them out at all if you don't need them.  That's another story...

> Okay, I filled a bug report (#14262) about avr-libc documentation

Thanks, I saw it.

> but when I use -nostartfiles, I also loose the vector table, so I
> guess that I've to build and provide my own?

That's why I suggested you'd better make a copy of gcrt1.S for your
project, and edit it to fit your needs.  Just don't touch the
remaining entries, so you won't loose anything (like the vector

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

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