-fno-exceptions and libgcc.a
Joe Buck
jbuck@synopsys.com
Mon Oct 6 09:55:00 GMT 1997
> Mark> I suggest a different scheme:
>
> Mark> o The default remains -fno-exceptions when compiling.
>
> Mark> o At link-time, if gcc is used to link the executable, we
> Mark> remove the .eh_frame section. If g++/c++ is used, we keep it.
>
> Hm. I tend to forget "g++" even exists -- I always compile everything
> by calling "gcc" and letting it sort out what to do with the file.
All g++ and c++ do is invoke gcc with the right options, so what Mark
is really saying is that there is a flag that tells the linker (or some
program that is run just before the linker, like collect) to remove
the .eh_frame section. My counter-proposal was to have the linker
remove the .eh_frame section if and only if no code in the executable
throws an exception (meaning that there is some flag in the object
file indicating this). Of course this can only be an optimization;
some users will have collect + the native linker.
> Conversely, you also need a solution for those who invoke "ld"
> directly (as opposed to indirectly via gcc or g++).
Those who invoke ld directly, unless they are using the GNU linker,
won't get correct C++ programs (since constructors for file-scope
objects won't be called).
More information about the Gcc
mailing list