From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 18D763858006; Tue, 2 Feb 2021 23:59:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18D763858006 From: "manojgupta at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/98946] New: GCC generating incorrect relocation R_386_GOTOFF in .debug-info for x86 (32) Date: Tue, 02 Feb 2021 23:59:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manojgupta at google dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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: Tue, 02 Feb 2021 23:59:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98946 Bug ID: 98946 Summary: GCC generating incorrect relocation R_386_GOTOFF in .debug-info for x86 (32) Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: manojgupta at google dot com Target Milestone: --- Created attachment 50116 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50116&action=3Dedit pre-processed files and gcc command limes This might be related to an older bug 82630 that fixed a similar issue for R_386_GOTPC relocations. Chromium OS bug: https://bugs.chromium.org/p/chromium/issues/detail?id=3D11= 71829 We are hitting a similar problem when upgrading to GCC 10.2.1 in Chrome OS.= the affected files are in glibc 2.27 where the presence of R_386_GOTOFF is caus= ing LLD linker to complain. This is breaking static linking on 32-bit for us. The errors look like: ld.lld: error: dl-close.c:(.debug_info+0x1E6A): has non-ABS relocation R_386_GOTOFF against symbol '.LC3' ld.lld: error: dl-profile.c:(.debug_info+0x1A7C): has non-ABS relocation R_386_GOTOFF against symbol '.LC4' ld.lld: error: dl-lookup.c:(.debug_info+0x23FA): has non-ABS relocation R_386_GOTOFF against symbol '.LC8' ld.lld: error: dl-reloc.c:(.debug_info+0x3555): has non-ABS relocation R_386_GOTOFF against symbol '.LC7' ld.lld: error: dl-load.c:(.debug_info+0x1B1C): has non-ABS relocation R_386_GOTOFF against symbol '.LC65' ld.lld: error: malloc.c:(.debug_info+0x28D5): has non-ABS relocation R_386_GOTOFF against symbol '.LC2' ld.lld: error: plural.c:(.debug_loc+0xFA4): has non-ABS relocation R_386_GO= TOFF against symbol 'yyr2' It was suggested on the bug by Fangrui who is our LLD expert that this migh= t be a GCC bug. "Relocations from .debug_info referencing .text.* can only be absolute relocation types or DTPREL (TLS)-like." There was a previous fix for a similar bug: https://gcc.gnu.org/git/?p=3Dgcc.git&a=3Dcommit;h=3D6b10f1741a1d79c9e32e879= 0fb98ba93c864b219 . Maybe the fix needs to be extended to handle the R_386_GOTOFF relocations. I am attaching one of the files LLD is complaining (dl-close.c) with intermediate steps and output of "-v" command line. The assembler being use= d is GNU assembler 2.35.1. Please let me know if more information is needed.=