Using g++ 3.3.1 (same results with 3.3.4) and binutils 2.14: Configured with: ../gcc-3.3.1/configure --prefix=/vol/gnu/gcc-3.3.1 --enable-shared --enable-threads --enable-cpp --enable-languages=c++ --with-gnu-as --with-as=/vol/gnu/gcc-3.3.1/bin/as --with-gnu-ld --with-ld=/vol/gnu/gcc-3.3.1/bin/ld --host=sparc-sun-solaris2.8 Thread model: posix gcc version 3.3.1 we get many errors like the following when trying to link an executable (all libraries and .o files have been built 64-bit (-m64 option): /vol/gnu/gcc-3.3.1/bin/g++ -m64 -o /vobs/toe/local/bin/sun5g/toe sun5g/VersionInfo.o sun5g/toe.o /vobs/toe/src/lib/*/sun5g/*.o /vobs/is_foundations/snacc/lib/sun5g/obj/*.o /vobs/is_foundations/vendor/zregx/zregx-2.1a/objs/*.o -O2 -Xlinker -E -lpthread -lposix4 -liberty -ldl -lnsl -lsocket -lstdc++ -R/usr/local/lib/gcc-3.3.1/sparcv9 /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x128):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:41: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN9TOEStringD1Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x148):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:42: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN4xstr7xstringINS_12var_char_bufILm32EcSt11char_traitsIcESaIcEEEED2Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x168):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:35: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN9TOEStringD0Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x188):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:36: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN4xstr12var_char_bufILm32EcSt11char_traitsIcESaIcEED2Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x1a8):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:36: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN4xstr12var_char_bufILm32EcSt11char_traitsIcESaIcEE17release_resourcesEv /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x1c8):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:36: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN4xstr7xstringINS_12var_char_bufILm32EcSt11char_traitsIcESaIcEEEED1Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x1e8):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:37: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN4xstr7xstringINS_12var_char_bufILm32EcSt11char_traitsIcESaIcEEEED0Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x208):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:40: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN4xstr12var_char_bufILm32EcSt11char_traitsIcESaIcEED1Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacet.o(.eh_frame+0x228):/vobs/toe/src/lib/cfg/TOECfgFacet.cc:40: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN4xstr12var_char_bufILm32EcSt11char_traitsIcESaIcEED0Ev /vobs/toe/src/lib/cfg/sun5g/TOECfgFacility.o(.eh_frame+0x308):/vol/gnu/gcc-3.3.1/include/c++/3.3.1/ext/stl_hashtable.h:898: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN9TOEStringC1ERKSs /vobs/toe/src/lib/cfg/sun5g/TOECfgFacility.o(.eh_frame+0x328):/vobs/toe/src/lib/cfg/TOECfgFacility.cc:52: relocation truncated to fit: R_SPARC_DISP32 .gnu.linkonce.t._ZN9TOEStringD1Ev ...
Are you sure that binutils 2.14 is being used as there was a ld bug which had the same symptom, see PR 7506. Also most likely this is not a GCC bug at all but a binutils one.
Thanks, Andrew. You are right. It's apprently a binutils bug. I tried the latest snapshot of binutils (040909) and the problem goes away. I couldn't use the latest release (2.15) because it has a core dump problem on Solaris 8.
Binutils 2.15 release is indeed broken on the platform; however binutils 2.15 CVS should work fine.