http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59380
Bug ID: 59380 Summary: libstdc++.a: could not read symbols: Bad value Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: cnstar9988 at gmail dot com libstdc++.a: could not read symbols: Bad value gcc 4.8.2 ====foo.cc===== #include <iostream> void foo() { std::cout << 42 << std::endl; } g++ -pthread -fPIC -o foo.so -shared foo.cc [root@hpblade01 ~]# g++ -pthread -fPIC -o foo.so -shared foo.cc /usr/bin/ld: /opt/gcc-4.8.2/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/libstdc++.a(ios_init.o): relocation R_X86_64_32 against `__pthread_key_create' can not be used when making a shared object; recompile with -fPIC /opt/gcc-4.8.2/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/libstdc++.a: could not read symbols: Bad value collect2: error: ld returned 1 exit status ======= Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/gcc-4.8.2/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper Target: x86_64-redhat-linux Configured with: ../src/configure --prefix=/opt/gcc-4.8.2 --enable-languages=c,c++ --with-pic --disable-shared --enable-threads=posix --enable-checking=release --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --disable-nls --with-cpu=generic --disable-multilib --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.2 (GCC)