https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67834
Bug ID: 67834 Summary: [5 Regression] Local references inside comdat groups Product: gcc Version: 5.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: danglin at gcc dot gnu.org Target Milestone: --- Host: hppa-unknown-linux-gnu Target: hppa-unknown-linux-gnu Build: hppa-unknown-linux-gnu Created attachment 36442 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36442&action=edit Preprocessed source With the switch to gcc-5 on Debian, we are seeing a number of c++ packages fail to build with the following error: _ZXXX referenced in section `.data.rel.ro.local' of YYY: defined in discarded section `.text._ZXXX Here is the assembler code for _ZN3uhd9transport3sphL19handle_overflow_nopEv: .section .text._ZN3uhd9transport3sphL19handle_overflow_nopEv,"axG",@progbits,_ZN3uhd9transport3sph19recv_packet_handler6resizeEj,comdat .align 4 .type _ZN3uhd9transport3sphL19handle_overflow_nopEv, @function .LFB8296: .file 6 "/home/dave/debian/uhd/uhd-3.9.1/host/lib/usrp/usrp1/../../transport/super_recv_packet_handler.hpp" .loc 6 61 0 .cfi_startproc _ZN3uhd9transport3sphL19handle_overflow_nopEv: .PROC .CALLINFO FRAME=0,NO_CALLS .ENTRY bv,n %r0(%r2) .EXIT .PROCEND .cfi_endproc .LFE8296: .size _ZN3uhd9transport3sphL19handle_overflow_nopEv, .-_ZN3uhd9transport3sphL19handle_overflow_nopEv Subsequently, there is a reference from a plabel in .data.rel.ro.local: .section .data.rel.ro.local .align 4 .LC135: .word P%_ZN3uhd9transport3sphL19handle_overflow_nopEv COMDAT group section [ 10] `.group' [_ZN3uhd9transport3sph19recv_packet_handler6resizeEj] contains 2 sections: [Index] Name [ 581] .text._ZN3uhd9transport3sphL19handle_overflow_nopEv [ 1282] .text._ZN3uhd9transport3sph19recv_packet_handler6resizeEj It is my understanding that local references into COMDAT groups are not allowed. HPPA is probably particularly sensitive to this because of the "P" PLABEL32 reloc. Compile command: /usr/bin/c++ -DHAVE_CONFIG_H -DIHEX_USE_STDBOOL -DUHD_DLL_EXPORTS -DUHD_IMAGES_DIR=OFF -DUHD_VERSION=30901 -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -I/home/dave/debian/uhd/uhd-3.9.1/build/include -I/home/dave/debian/uhd/uhd-3.9.1/host/include -I/home/dave/debian/uhd/uhd-3.9.1/build/lib/ic_reg_maps -I/home/dave/debian/uhd/uhd-3.9.1/host/lib/convert -I/home/dave/debian/uhd/uhd-3.9.1/build/lib/convert -I/home/dave/debian/uhd/uhd-3.9.1/build/lib/transport/nirio/lvbitx -I/usr/include/libusb-1.0 -I/home/dave/debian/uhd/uhd-3.9.1/host/lib/usrp -I/home/dave/debian/uhd/uhd-3.9.1/host/lib/usrp/cores -I/home/dave/debian/uhd/uhd-3.9.1/host/../firmware/fx2/common -I/home/dave/debian/uhd/uhd-3.9.1/host/lib/usrp/common -I/home/dave/debian/uhd/uhd-3.9.1/host/lib/usrp/common/ad9361_driver -Wall -Wextra -Wsign-compare -o CMakeFiles/uhd.dir/usrp/usrp1/io_impl.cpp.o -c /home/dave/debian/uhd/uhd-3.9.1/host/lib/usrp/usrp1/io_impl.cpp