From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 467C73858C41; Mon, 12 Feb 2024 13:10:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 467C73858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707743444; bh=B4KMXZjR0I9ps2w7p/nrYGnQqMJu4yt3LiI01nuPCr4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vzBnzGLkTooRn0Wu6oiIr12AlfL8xhtRHl+AaCDb5vKSm7sWbgbNo/o+BIm6UTYmM 8YMYewKAO7UQRaqosJsYRhdKsS6r2Uyw4yGz5BrYoXk+pTNhuLLeSZBfFPVoki9tcy wS6ILInc3FlArhp5SkYyqN5JkJRHlEhD7pAjT7r8= From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31372] _dl_tlsdesc_dynamic doesn't preserve vector registers Date: Mon, 12 Feb 2024 13:10:43 +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.40 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com 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: security- 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31372 --- Comment #4 from H.J. Lu --- (In reply to Florian Weimer from comment #3) > (In reply to Florian Weimer from comment #2) > > I think we need more discussion what the ABI should be like. > >=20 > > The trampoline does not need to save argument registers. >=20 > Or maybe it does. We should have official ABI clarification. It is explicitly documented: https://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-x86.txt --- The functions defined above use custom calling conventions that require them to preserve any registers they modify. This penalizes the case that requires dynamic TLS, since it must preserve (*) all call-clobbered registers before calling __tls_get_addr(), but it is optimized for the most common case of static TLS, and also for the case in which the code generated by the compiler can be relaxed by the linker to a more efficient access model: being able to assume no registers are clobbered by the call tends to improve register allocation. Also, the function that handles the dynamic TLS case will most often be able to avoid calling __tls_get_addr(), thus potentially avoiding the need for preserving registers. --- --=20 You are receiving this mail because: You are on the CC list for the bug.=