other/9691: Shared libraries don't work with g++
Thu Feb 13 12:16:00 GMT 2003
>Synopsis: Shared libraries don't work with g++
>Arrival-Date: Thu Feb 13 12:16:00 UTC 2003
>Originator: Christian Corti
>Release: gcc 3.2.1
DECstation 5000/260 MIPS R4400; NetBSD 1.6;
g++ can't create working or use shared libraries.
Programs linked against such libraries will crash on loading with a segmentation
My test program compiled with 'g++-3.2 -o test test.cc':
std::cout << "Hello!\n";
Output of 'ldd test'
-lm.0 => /usr/lib/libm.so.0
-lstdc++.5 => /usr/local/lib/libstdc++.so.5
-lc.12 => /usr/lib/libc.so.12
-lgcc_s.1 => /usr/local/lib/libgcc_s.so.1
Output of 'gcc-3.2 -v'
Configured with: ../gcc-3.2.1/configure --host=mipsel-dec-netbsd1.6
Output of '/usr/local/bin/ld -v':
GNU ld version 220.127.116.11
Output of '/usr/local/bin/as -v':
GNU assembler version 18.104.22.168 (mipsel-dec-netbsd1.6) using
BFD version 22.214.171.124
Output of 'gdb test test.core'
#0 0x5ffe5b30 in _rtld_relocate_objects () from /usr/libexec/ld.elf_so
Creating a statically linked version of this program works,
i.e. "g++-3.2 -static -o test test.cc" produces a working
The same problem occurs with binutils 2.11.2.
binutils 2.9.1 can't be used for compiling gcc 3.2.1 on
mipsel as this will lead to an assembler error during
compilation of one of the libgcc files.
I tried g++ 3.2.1 on a SUN 4/260 (sun4) with SunOS 4.1.1
and it is broken too. gcc 3.2.1 however works fine on all
Any program compiled with g++ will crash on loading.
More information about the Gcc-bugs