This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: linker question: rtti/exception functions


Hi,

...
> 
> >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.
> 
> You can find the trail of why they get called in by producing a linker
> map (pass -Wl,-Map,file.map to gcc/g++ to generate file.map) which
> contains in it the list of files that are pulled in, and because of
> which symbol.  Once you start looking at the chain of you can figure out
> the why part... 
> 

Thanks for the advice, this looks really interesting!

Now, I have found the following: defining a trivial (i.e. empty) destructor 
introduces a reference to __builtin_delete from libgcc.a, and this in turn 
references __throw and so on... This explains how these modules from 
libgcc.a are pulled in. 

What I don't understand is the reason for this reference to __builtin_delete.
What puzzles me is that an empty destructor invokes (or at least somehow
references) a memory management function. I do not use new() or delete()
in my test example; I simply declared a object in global scope.

Any idea?

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


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