This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ pure virtual base class memory consumption


Hello Fueb

On Tuesday 21 August 2012 20:39:25 fueb wrote:
> Sebastian Huber-4 wrote:
> > Are you sure this code is from Newlib and not GCC?
>
> I think the code is being inserted by GCC and in turn many things from
> newlib get linked in.
> ../arm-none-eabi/lib/thumb2\libstdc++.a(pure.o)
> ../arm-none-eabi/lib/thumb2\libstdc++.a(eh_terminate.o)
> ../arm-none-eabi/lib/thumb2\libstdc++.a(eh_call.o)
> ../arm-none-eabi/lib/thumb2\libstdc++.a(eh_exception.o)
>
> and may other things I cannot post here since the mapfile is quite large.

the compiler has to ensure for abstract method/class that it throws
exception when called. This means that code contains references for
exception handling function then and these are pulled from libraries.

You can try to compile your code with

gcc -fno-exceptions -fno-rtti

to reduce binary size if you do not need exception handling
and RTTI.

If that does not help, then it is possible that whole stdc++
libarary has to be rebuild again without exception handling.
But it should not be necessary.

Best wishes,


                Pavel Pisa
--
    e-mail:     pisa@cmp.felk.cvut.cz
    www:        http://cmp.felk.cvut.cz/~pisa
    university: http://dce.fel.cvut.cz/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]