From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 17C6B3858D37; Sun, 11 Feb 2024 18:37:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17C6B3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707676648; bh=Ia5xOEgVEkd3Np7XeBLhsvGi+ipWg/cMUh1p+kMUlkM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KYWCl9O1q3bxt1/p0XK/2IfKyHvVNN6zuhXvxCKIxr/X8mFr9EwZoSBLxLpqIhAzN sOMzAtXoycutMhxIzI8pi+MhFBu+/w+WEjMAszV0rm/+KcLnxfbMgx7zuhZ3Ew0/gS OH9ISV12sx3HNhohCv/DAhI2RR3VMWISyuZ2RVj8= From: "fw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu Date: Sun, 11 Feb 2024 18:37:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: fw at gcc dot gnu.org X-Bugzilla-Status: NEW 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113874 --- Comment #6 from Florian Weimer --- > (In reply to H.J. Lu from comment #4) > > (In reply to H.J. Lu from comment #3) > > > Created attachment 57385 [details] > > > A patch > > >=20 > > > Try this. > >=20 > > This doesn't work properly. To work around in ld.so, _dl_tlsdesc_dynam= ic > > needs to save and restore ALL registers, which can be expensive. Why doesn't this work properly? Is it possible to make it work with a diffe= rent approach? The __tls_get_addr call with the default approach potentially needs to solve the same problem, doesn't it? (In reply to Jakub Jelinek from comment #5) > Or it could be compiled with options to make sure it doesn't use vector > registers etc., and only save/restore if it needs to call into some code > where libc can't afford that (say allocate memory). We currently call into malloc, which could be a replacement malloc. If GCC cannot be fixed, full context switch or elimination of the slow path are our best options for a glibc-side fix.=