avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [RFC] sections stub patch


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [RFC] sections stub patch
Date: Wed, 28 Aug 2002 22:57:48 +0200
User-agent: Mutt/1.2.5i

As Joerg Wunsch wrote:

> > How does the .ctors and .dtors section work with .init6/.fini6 then?
> 
> Well, i tried hard to get a simple C++ file compiled...  It always
> stumples across an undefined reference to __gxx_personality_sj0 which
> it apparently expects to be a library-supplied global variable.  Hmm.
> The value is copied over to the stack of main(), but never used.  I
> wonder what it's good for.  If i declare an int variable in my program
> with that name, it at least compiles. ;-)
> 
> As soon as there's at least one of .ctors or .dtors non-empty, .init6
> requests the inclusion of __do_global_ctors(), and .fini6 the
> inclusion of __do_global_dtors().
> 
> I've been surprised that even a /very/ simple C++ file eats up almost
> 2 KB of flash. :-(  A lot of the bloat accounts to calls to various
> _Unwind_XXX functions, the remainder is regular library stuff
> (including those functions that were called by my test class).

All this _Unwind_foo and __gxx_personality_sj0 stuff is required for
exception handling, which basically requires a working libstdc++ (which
we don't have).  So the only chance is to run the compiler with
-fno-exceptions -- which will also reduce my simple test file to < 500
bytes of flash, which is quite a bit closer to what i would expect. ;)
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

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