[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] [Fwd: building gcc/g++]
From: |
reinhard . jessich |
Subject: |
Re: [avr-gcc-list] [Fwd: building gcc/g++] |
Date: |
Wed, 9 Jan 2002 22:58:28 +0100 |
On Wed, 09 Jan 2002, Peter Jansen wrote:
<snip>
> > I have found the __CTOR_LIST__ in the asm output.
> >
> > Is anybody working on a solution of this problem?
>
>
> Yes we have just come across this problem, today we have fixed g++ to
> make this all work om the mega128 (which is what we are using).
>
> It required the following fixes,
>
> 1. Put the con/destructor table in .ctors/.dtors sections, and make the
> linker script handle them.
I did:
Changes to avr.h:
I have added the definitions of ASM_OUTPUT_CONSTRUCTOR,
ASM_OUTPUT_DESTRUCTOR and added in_ctors, in_dtors to
EXTRA_SECTIONS. In EXTRA_SECTION_FUNCTIONS I added the
functions to emit the ctors and dtors sections.
I got them from elfos.h.
> 2. Write a do_global_constructors function.
I defined __do_global_ctors and __do_global_dtors functions in libgcc.S.
> 3. Call the do_global_constructors from the startup code.
I don't know where and how to add this? I am analysing how the m86hc11 does
this. As far as I have understand this, it uses a .global with the function
name in the file where it defines the constructor table. For the do_global_xxx
funktions it defines a new section in the linke script, so that the are
inserted just befor the main code.
I like this solution, because it needs no changes to the startup code in the
libc. How have you solved the problem?
As I linked a program I got the error that the data section and the ctors do
overlay. I am not familar with the linker scripts, but maybe you have a hint?
Maybe it's better to wait until you are ready and then try it with the smaller
avr's?
> I'm quite busy at the moment, but I will try and make patches for this,
> I still have to do something for the other avr's (unless you would like to)
As I wrote in one of my previous mails, I am not so familar with the avr. I
still have to learn the assember.
> here are the two messages to avr-gcc-list with the 3.0.2 patches for the
> mega128 support, these wont patch againsed the current CVS tree I don't
> think.
>
> http://avr.jpk.co.nz/pipermail/avr-gcc-list/2001-November/001048.html
> http://avr.jpk.co.nz/pipermail/avr-gcc-list/2001-November/001049.html
Thank you!
> When I finish the constructor/destructor stuff, Ill get the latest CVS
> source update the patches and send them to the gcc/binutils maintainers.
>
> The stuff for avr-libc is already in the latest avr-libc for the
> ATmega128 at
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
- [avr-gcc-list] [Fwd: building gcc/g++], Peter Jansen, 2002/01/09
- Message not available
- Re: [avr-gcc-list] [Fwd: building gcc/g++], Peter Jansen, 2002/01/09
- Re: [avr-gcc-list] [Fwd: building gcc/g++], reinhard . jessich, 2002/01/09
- Re: [avr-gcc-list] [Fwd: building gcc/g++], Peter Jansen, 2002/01/09
- Re: [avr-gcc-list] [Fwd: building gcc/g++],
reinhard . jessich <=
- Re: [avr-gcc-list] [Fwd: building gcc/g++], Peter Jansen, 2002/01/12
- Re: [avr-gcc-list] [Fwd: building gcc/g++], reinhard . jessich, 2002/01/12
- Re: [avr-gcc-list] [Fwd: building gcc/g++], Peter Jansen, 2002/01/12