PATCH: Put libunwind.a in libgcc_s.so: versioning of _Unwind_*() symbols
David Mosberger
davidm@napali.hpl.hp.com
Wed Apr 21 06:53:00 GMT 2004
>>>>> On Tue, 20 Apr 2004 22:57:29 -0700, "H. J. Lu" <hjl@lucon.org> said:
H> This patch puts libunwind.a in libgcc_s.so.1. The test result is at
H> http://gcc.gnu.org/ml/gcc-testresults/2004-04/msg00974.html
H> We can do it on ia64 since PIC is default on ia64.
I suppose that's progress, but I still think it's wrong for GCC to
version symbols that are defined by the C++ ABI. To witness:
$ cat t.cxx
#include <stdio.h>
void
foo (void)
{
char myarray[10];
try
{
for (int n=0; n<=10; n++)
{
if (n>9) throw "Out of range";
myarray[n]='z';
}
}
catch (const char * str)
{
printf ("Exception: %s\n", str);
}
}
$ cat main.cxx
extern void foo (void);
int
main (int argc, char **argv)
{
foo ();
}
$ g++-3.4 -shared -export-dynamic -o t.so t.cxx
$ icc main.cxx t.so
t.so: undefined reference to `__cxa_begin_catch@CXXABI_1.3'
t.so: undefined reference to `__cxa_allocate_exception@CXXABI_1.3'
t.so: undefined reference to `_ZTIPKc@CXXABI_1.3'
t.so: undefined reference to `__gxx_personality_v0@CXXABI_1.3'
t.so: undefined reference to `__cxa_end_catch@CXXABI_1.3'
t.so: undefined reference to `__cxa_throw@CXXABI_1.3'
Here, icc is the Intel compiler (v8.0). Unless the C++ ABI defines
symbols to be versioned with CXXABI_1.3, this just seems wrong to me.
BTW: the above compiles and links just fine with g++ v3.3.
--david
More information about the Gcc
mailing list