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: Reducing the size of C++ executables - eliminating malloc


On Sun, Nov 12, 2006 at 11:17:14PM +0000, Paul Brook wrote:
> The code being unwound through (ie. with frame data) needs to be able to 
> say "I need routine X if __Unwind_Raise is used anywhere in this program".
> I'm not aware of any way of doing this, other than trying it and starting 
> again if you guessed wrong.

Again, IIRC ARM's linker does something clever here.  Of course the ABI
in use there is somewhat different, but I suspect it could be adapted.

On Sun, Nov 12, 2006 at 03:20:48PM -0800, Mark Mitchell wrote:
> But, the way the ABI works requires a reference from each unit which may
> cause unwinding.  Even if you lose the personality routine, you will
> still have the exception tables, which themselves are a significant
> cost.  If you don't want to pay for exceptions, you really have to
> compile with -fno-exceptions.  In that case, certainly, we should be
> able to avoid pulling in the personality routine.

If you try what Michael's been saying, you'll notice that trivial
C++ files get the personality routine reference even if they don't
have anything with a destructor which would need cleaning up.  We ought
to be able to emit (somewhat smaller) unwind information which doesn't
reference the personality routine if it's going to have nothing to do,
shouldn't we?

-- 
Daniel Jacobowitz
CodeSourcery


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