This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fexceptions and C: Performance penalties?
On Fri, May 14, 1999 at 01:40:54PM +0200, Andreas Schwab wrote:
> Andi Kleen <ak@muc.de> writes:
>
> |> The only cost in compiling with -fexceptions is that the binary image gets
> |> bigger because of the unwind tables generated. egcs 1.1 is clever enough
> |> to put them into a separate ELF section which puts them into separate pages,
> |> so if you never throw a exception the tables will most likely be never loaded
> |> by the kernel. Therefore except for some wasted disk space -fexceptions
> |> for the C library should be free.
>
> The last time I checked the .eh_frame must be relocated, so that there is
> a non-negligible startup overhead.
Ooops. I sit corrected then.
This is very bad. I guess there is no easy way to avoid this?
One way that comes to mind would be to teach libgcc about the dynamic linker,
so that the exception table section is marked with a special "don't relocate
yet" flag, and libgcc guarantees to call a relocating function in ld.so
before walking the tables.
-Andi
--
This is like TV. I don't like TV.