From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CD8B3892453; Wed, 3 Feb 2021 07:57:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CD8B3892453 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/98946] GCC generating incorrect relocation R_386_GOTOFF in .debug-info for x86 (32) Date: Wed, 03 Feb 2021 07:57:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: wrong-debug X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: bug_status resolution 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, 03 Feb 2021 07:57:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98946 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #5 from Jakub Jelinek --- No, that is a lld bug, there is no such rule that would say these relocatio= ns can't be applied against non-allocated or debug sections. GCC var-tracking figures out that the last argument passed to __assert_fail= is equivalent to %ebx + __PRETTY_FUNCTION__.0@gotoff, but can't prove that %ebx will be equal to __GLOBAL_OFFSET_TABLE__, so can't emit there just __PRETTY_FUNCTION__.0 - while %ebx must be some __GLOBAL_OFFSET_TABLE__ pointer, it could have been adjusted, so e.g. it could be __GLOBAL_OFFSET_TABLE__ + index and the needed value would then be __PRETTY_FUNCTION__.0 + index. And we want to emit as compact debug info as possible, so emitting it as %ebx + __PRETTY_FUNCTION__.0@gotoff rather than say (%ebx - __GLOBAL_OFFSET_TABLE__) + __PRETTY_FUNCTION__.0, especially because referencing __GLOBAL_OFFSET_TABLE__ symbol in assembly poses interesting problem (implies special relocations).=