https://sourceware.org/bugzilla/show_bug.cgi?id=19579
Andreas Krebbel <krebbel at linux dot vnet.ibm.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |krebbel at linux dot vnet.ibm.com --- Comment #5 from Andreas Krebbel <krebbel at linux dot vnet.ibm.com> --- I can reproduce the failure building mopac7-1.15 with -fPIC and -pie. The problem disappears when omitting -pie. The error gets reported after elf_s390_finish_dynamic_symbol returned false here: else if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h)) { /* If this is a static link, or it is a -Bsymbolic link and the symbol is defined locally or was forced to be local because of a version file, we just want to emit a RELATIVE reloc. The entry in the global offset table will already have been initialized in the relocate_section function. */ ----> if (!h->def_regular) return FALSE; The symbol in question is geovar_ : $ readelf -s ./.libs/libmopac7.so | grep geovar_ 388: 000000000399f920 8656 OBJECT GLOBAL DEFAULT 22 geovar_ 5819: 000000000399f920 8656 OBJECT GLOBAL DEFAULT 22 geovar_ $ readelf -s mopac7app.o | grep geovar 160: 0000000000000008 5768 OBJECT GLOBAL DEFAULT COM geovar_ It is not clear to me yet how this is supposed to work correctly yet. As usual I've tried to figure out what x86 is doing but I ran into similiar problems: with 2.23.52 I see the very same problem as on s390: /bin/sh ../libtool --tag=F77 --mode=link gfortran -g -O2 -std=legacy -fno-automatic -fPIC -lm -Wl,-- gfortran -g -O2 -std=legacy -fno-automatic -fPIC -Wl,--as-needed -Wl,-z -Wl,defs -pie -o .libs/mopac7 m /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status make[1]: *** [mopac7] Error 1 Using head binutils however I get: gfortran -g -O2 -std=legacy -fno-automatic -fPIC -Wl,--as-needed -Wl,-z -Wl,defs -pie -o .libs/mopac7 mopac7app.o ./.libs/libmopac7.so -lm -Wl,--rpath -Wl,/home/andreas/mopac/install/lib /home/andreas/binutils/binutils-26022016-install/bin/ld: mopac7app.o: relocation R_X86_64_PC32 against undefined symbol `geokst_' can not be used when making a shared object; recompile with -fPIC /home/andreas/binutils/binutils-26022016-install/bin/ld: final link failed: Bad value Although everything is built with -fPIC I'll continue next week. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils