From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A21953858C27; Mon, 18 Apr 2022 15:57:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A21953858C27 From: "i at maskray dot me" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/29071] m68k: Removal of ELF_DURING_STARTUP optimization broke ld.so Date: Mon, 18 Apr 2022 15:57:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: adhemerval.zanella at linaro dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2022 15:57:25 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29071 --- Comment #9 from Fangrui Song --- Unrolling this may mitigate the issue likely because the optimization is related to loop-invariant code motion. gcc somehow decides hoisting the GOT address of the jump table is beneficial (for such a non-PI_STATIC_AND_HIDDEN arch). musl ld.so uses a function call as a barrier (__dls2) to avoid such code generation problems. (In reply to Andreas Schwab from comment #8) > Created attachment 14070 [details] > handle less relocation types during ld.so bootstrap >=20 > Please try this instead. Thanks. This looks good to me. `case R_68K_NONE` can also be placed in `#if= def RTLD_BOOTSTRAP` if it helps reduce the possibility that gcc uses a jump tab= le (which needs a relocated address in a GOT entry). --=20 You are receiving this mail because: You are on the CC list for the bug.=