From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacques.Herry@infineon.com To: gcc-help@gcc.gnu.org Subject: Relocation error under Solaris 2.95.2 and GCC 2.95.2 Date: Wed, 26 Sep 2001 08:05:00 -0000 Message-id: <9125AE321C26D311A7D900805F8BB94A0141A413@mail.vlb.infineon.com> X-SW-Source: 2001-09/msg00120.html Hello All, When linking to create a dynamic library, I get the following error: ld: warning: relocation error: R_SPARC_32: file test2.o: symbol : external symbolic relocation against non-allocatable section .stab; cannot be processed at runtime: relocation ignored The command line used to link is: g++ -shared -fPIC -o test.so test1.o test2.o The command line used to compile is: g++ -g -mcpu=v8 -Wall -pedantic -fPIC -c -o test1.o test1.cc When compiling with the option -O2 and the same link command, the error disappears. When compiling and linking without the options -fPIC and -shared (static library), the error disappears. The used configuration is the following: Solaris 2.5.1 up-to-date concerning the patches gcc 2.95.2 SUN's assembler and linker I read on the net to use the Gnu assembler and linker. Is it the solution? If yes, which version of the assembler and linker should I use with the mentioned configuration? Do I need to recompile GCC with these new tools? (If yes, which options?) How configure GCC to use the new tools? Do I need to recompile the libraries? What's about the system libraries? Thanks, Jacques