Solaris-- relocation against external symbol

Ian Lance Taylor
Mon Aug 10 14:10:00 GMT 1998

   From: (Yao-Chiang Kan)
   Date: Wed, 5 Aug 1998 12:25:23 -0400 (EDT)

     I installed the binutils-2.9.1 on our Solaris 2.51 system
   and the relocation error still happen. So I renamed the /usr/ccs/bin/ld
   and linked the new ld to /usr/ccs/bin/ld. Then the following error
   poped on the screen.
     g++  array.o -o array -L../lib -lblitz -lm
     could not read symbols: Bad value
     collect2: ld returned 1 exit status                                           

     Any suggestion?

I saw a similar problem recently.  It arose when using the Solaris
native assembler with -fpic (or -fPIC) and using the GNU linker to
produce a shared library.  The easy workaround is to use the GNU
assembler instead.


More information about the Gcc-bugs mailing list