From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4923F38582A1; Tue, 30 Jan 2024 13:25:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4923F38582A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706621128; bh=ZyiRcZr2U1N3RVIh5p0AYNKhVhiU0NRasnW5O5BEMPU=; h=From:To:Subject:Date:From; b=Lbya6nCHx9B0P8UzDlOmJ5BpLDC8R9y9o61zLM4w+/Z4lnOMcW1zyKpF4jVTSIKZE bSTKWfNgrJB/zWq4Vi0UuwShC+tf6HDUkwebR+04cAmf+a0OSyftvnZk08Wnm7NYQe Nj2x0b95WEaIfwee8kxegST+w4oks0C31pqQucWk= From: "schwab@linux-m68k.org" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31317] New: [RISCV] static PIE crashes during self relocation Date: Tue, 30 Jan 2024 13:25:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.39 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: schwab@linux-m68k.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31317 Bug ID: 31317 Summary: [RISCV] static PIE crashes during self relocation Product: glibc Version: 2.39 Status: NEW Severity: normal Priority: P2 Component: dynamic-link Assignee: unassigned at sourceware dot org Reporter: schwab@linux-m68k.org Target Milestone: --- When running a static PIE created by the mold linker, it crashes during self relocation while it tries to look up the __global_pointer$ symbols. That happens because the mold linker puts the relocation addend of a RELATIVE al= so in the relocated field (unlike the BFD linker, which sets it to zero). >From sysdeps/riscv/dl-machine.h: if (l->l_type =3D=3D lt_executable && l->l_scope !=3D NULL) In elf_machine_runtime_setup the condition l->l_scope !=3D NULL references = an unrelocated pointer (where l points to the statically initialized _dl_main_= map) which is never NULL in a static PIE produced by ld.mold. The failure can be seen in the mold testsuite (riscv64-ifunc-static-pie and riscv64-static-pie). https://build.opensuse.org/package/live_build_log/devel:gcc:next/mold/openS= USE_Factory_RISCV/riscv64 --=20 You are receiving this mail because: You are on the CC list for the bug.=