linker question: rtti/exception functions

Ruppert ru@swb.siemens.de
Wed Feb 13 07:37:00 GMT 2002


Hi,

I have configured gcc-2.95.3 as cross compiler for i386-rtemself and
have come across a problem when linking a small C++ example program:

Although I compile everything with -fno-exceptions and -fno-rtti
I get a bunch of functions from libgcc.a in the final executable which
are apparently intended for exception and rtti support ( __default_terminate,
__throw_type_match and many more, apparently all relating to rtti and
exception handling). To me it looks as if these functions are drawn
forcibly from libgcc.a (I have also written my own startup code, so I
am sure that I have not introduced any reference to these functions
there).

This does not only add to code size, which is an issue in embedded systems,
but also introduces some unresolved references to malloc, free, abort
etc. which I do not have nor need otherwise. I think I have tried the
obvious things: invoking gcc instead of g++, giving -fno-rtti etc. on
the linker invocation, but all this did not change anything.

Does anybody know if it is possible to get rid of this (or, how this
comes about)?

Any hint or explanation is greatly appreciated.


Best Regards
D.Ruppert
RTS GmbH
Schwieberdingen/Germany
ru@swb.siemens.de


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list