https://sourceware.org/bugzilla/show_bug.cgi?id=20996
Bug ID: 20996 Summary: build error with -O3 Product: binutils Version: 2.29 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: markus at trippelsdorf dot de CC: ian at airs dot com Target Milestone: --- gold doesn't build with gcc-trunk and -O3: ... x86_64-pc-linux-gnu-g++ -W -Wall -Wstack-usage=262144 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=dwp -flifetime-dse=1 -fnull-this-pointer -DBOOST_ERROR_CODE_HEAD ER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -march=amdfam10 -O3 -pipe -Wl,--no-demangle,--hash-style=gnu,--as-needed,--gc-sections,--icf=safe -o dwp dwp.o libgold.a ../libiberty/libiber ty.a -lpthread -ldl -lz -ldl dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi32ELb1EE5setupEv: error: undefined reference to '_ZN4gold28build_compressed_section_mapILi32ELb1EEEPSt3mapIjNS_23Compressed_sect ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb' dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi32ELb0EE5setupEv: error: undefined reference to '_ZN4gold28build_compressed_section_mapILi32ELb0EEEPSt3mapIjNS_23Compressed_sect ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb' dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi64ELb1EE5setupEv: error: undefined reference to '_ZN4gold28build_compressed_section_mapILi64ELb1EEEPSt3mapIjNS_23Compressed_sect ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb' dwp.o:dwp.cc:function _ZN4gold16Sized_relobj_dwoILi64ELb0EE5setupEv: error: undefined reference to '_ZN4gold28build_compressed_section_mapILi64ELb0EEEPSt3mapIjNS_23Compressed_sect ion_infoESt4lessIjESaISt4pairIKjS2_EEEPKhjPKcmPNS_6ObjectEb' collect2: error: ld returned 1 exit status It looks like the template function Compressed_section_map* build_compressed_section_map() needs to be explicitly instantiated in object.cc. Otherwise it will get optimized away. -- 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