From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D599538618F6; Wed, 17 Mar 2021 13:49:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D599538618F6 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/99618] `.gnu.debuglto_.debug_macro' referenced in section `.gnu.debuglto_.debug_macro' of X defined in discarded section Date: Wed, 17 Mar 2021 13:49:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2021 13:49:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99618 --- Comment #7 from H.J. Lu --- (In reply to Jakub Jelinek from comment #6) > For normal non-LTO debug macro we emit: > .section .debug_macro,"",@progbits > .Ldebug_macro0: > .value 0x5 # DWARF macro version number > .byte 0x2 # Flags: 32-bit, lineptr present > .long .Ldebug_line0 > .byte 0x7 # Import > .long .Ldebug_macro2 > ... > .section=20=20=20=20=20=20=20 > .debug_macro,"G",@progbits,wm4.0.d634b2ca9ddb72f687ab125549c033d0,comdat > .Ldebug_macro2: > .value 0x5 # DWARF macro version number > .byte 0 # Flags: 32-bit > .byte 0x5 # Define macro strp > .uleb128 0 # At line number 0 > ... > I don't see how that is any different from the above. The intent is (and= it > has been working fine for years) that linker merges the comdat sections w= ith > the same hash into one, and the import relocations resolve to the start of > that section. Same result: [hjl@gnu-cfl-2 pr27590]$ cat bad2.s=20 .section .gnu.debuglto_.debug_macro,"",@progbits .Ldebug_macro0: .long .Ldebug_macro2 .section .gnu.debuglto_.debug_macro,"G",@progbits,wm4,comdat .Ldebug_macro2: .value 0x4 [hjl@gnu-cfl-2 pr27590]$ gcc -c bad2.s [hjl@gnu-cfl-2 pr27590]$ ld -r bad2.o bad2.o `.gnu.debuglto_.debug_macro' referenced in section `.gnu.debuglto_.debug_ma= cro' of bad2.o: defined in discarded section `.gnu.debuglto_.debug_macro[wm4]' of bad2.o [hjl@gnu-cfl-2 pr27590]$=