trying to compile c++ files into a shared library using gcc 4.1.2 and ld 2.18. getting following error: gcc -shared -dy -L/hwapps/dvg/4.5.3/lib/Linux -o ./lib/Linux/libathirtt.so -lc -lm -lmdk ./obj/Linux/d.o ./obj/Linux/ds.o ./obj/Linux/dsa.o ./obj/Linux/s.o ./obj/Linux/sl.o ./obj/Linux/r.o ./obj/Linux/c.o ./obj/Linux/b.o ./obj/Linux/de.o ./obj/Linux/g.o ./obj/Linux/i.o ./obj/Linux/p.o ./obj/Linux/ra.o ./obj/Linux/re.o ./obj/Linux/unsolicited_trans.o ./obj/Linux/debug_port.o `.L527' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o: defined in discarded section `.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of ./obj/Linux/unsolicited_trans.o `.L529' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o: defined in discarded section `.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of ./obj/Linux/unsolicited_trans.o `.L534' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o: defined in discarded section `.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of ./obj/Linux/unsolicited_trans.o `.L536' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o: defined in discarded section `.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of ./obj/Linux/unsolicited_trans.o `.L539' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o: defined in discarded section `.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of ./obj/Linux/unsolicited_trans.o `.L542' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o: defined in discarded section `.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of ./obj/Linux/unsolicited_trans.o collect2: ld returned 1 exit status Any help would be appreciated!
It is an gcc bug. You can first try binutils 2.20 to see if it can work around it. If it doesn't work, you need to update your gcc.
No 2.18 or 2.19 updates are planned for FSF binutils, and as HJ says, this is really a gcc bug.