EH Performance

Mike Stump
Mon Feb 28 16:22:00 GMT 2000

> Date: Thu, 24 Feb 2000 16:03:23 -0500
> From: Eli Boling <>

> I've been looking at the EH implementation in gcc, and there are
> some things that I have noticed.  At least one vendor has disabled
> EH in their application because of this issue, and I'm wondering if
> thought has been put into it already.

If they disabled it, it is because they don't use it, or can afford to
not use it.  If they must use it, then they could not turn it off.

> First of all, the eh_frame section is marked as read/write

We have seen bugs in systems where the dynamic linker tries to run
relocs and dies when the code is RO.  But I agree, in general, I think
it would be good if it were RO, if it can be.

> in the image and, in the case of C++ auto destructor support, this
> section contains flat pointers into the .gcc_except_table section.
> This causes relocations to be emitted when you build a shared
> object, which will cause the eh_frame section to be paged in at
> application load time.


> Since the eh_frame section is large, this would appear to impact the
> startup performance of large applications.

What performance degradation are you seeing?  Or are you just worrying
about it?

> In addition to this, when the first exception is thrown in an
> application, the runtime libs do an initialization step on the
> eh_frame data which walks across *all* of the data in the entire
> application.  Since this data is large (Dwarf2), and the steps have
> poor locality,

I would have though they would have good locality.  Are they not all
in one section together?  Does it not run as fast as the disk
subsystem can get it in?

> it would appear that all of the eh_frame data is then paged in again
> when the first exception is tossed.  For a large application this
> could actually cause a significant performance issue for the first
> exception being thrown, and that's not too good.


> Can anyone give me any history on this topic?

[ I talked with him on the phone and we covered some of this...  I
  recommended in part to just submit patches for the problems found,
  and we'll take them on one by one.  ]

> There was a mention about an exception handling discussion list
> where the design of eh for gcc was discussed some time ago.  Does
> anyone have this list archived anywhere?

Kenner (or some of the Ada folks) or the Cygnus folks.  I had a copy,
I don't anymore.  Most of it is kinda old now, the important bits, I
can still conjure up on demand.  As time goes on, less and less of
them are interesting.  Most of the ones I will remember, I'd probably
consider obvious anyway.

More information about the Gcc mailing list