From owner-svn-src-all@freebsd.org Thu Jul 2 14:00:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A7499387D; Thu, 2 Jul 2015 14:00:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 599992C35; Thu, 2 Jul 2015 14:00:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t62E088D063564; Thu, 2 Jul 2015 14:00:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t62E08vq063562; Thu, 2 Jul 2015 14:00:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507021400.t62E08vq063562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 2 Jul 2015 14:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285038 - head/libexec/rtld-elf/aarch64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 14:00:08 -0000 Author: andrew Date: Thu Jul 2 14:00:07 2015 New Revision: 285038 URL: https://svnweb.freebsd.org/changeset/base/285038 Log: Save & restore the floating-pont argument registers before calling _rtld_bind. The compiler may generate code using these registers and not save them. Unfortunately, as we make use of libc, we are unable to disallow rtld from using floating-point register without also doing the same for the parts of libc we use, or by limiting what _rtld_bind is able to call. Obtained from: ABT Systems Ltd Sponsored by: The FReeBSD Foundation Modified: head/libexec/rtld-elf/aarch64/rtld_start.S Modified: head/libexec/rtld-elf/aarch64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_start.S Thu Jul 2 13:57:26 2015 (r285037) +++ head/libexec/rtld-elf/aarch64/rtld_start.S Thu Jul 2 14:00:07 2015 (r285038) @@ -70,6 +70,12 @@ ENTRY(_rtld_bind_start) stp x6, x7, [sp, #-16]! stp x8, xzr, [sp, #-16]! + /* Save any floating-point arguments */ + stp q0, q1, [sp, #-32]! + stp q2, q3, [sp, #-32]! + stp q4, q5, [sp, #-32]! + stp q6, q7, [sp, #-32]! + /* Calculate reloff */ ldr x2, [x17, #0] /* Get the address of the entry */ sub x1, x2, x16 /* Find its offset */ @@ -85,12 +91,16 @@ ENTRY(_rtld_bind_start) bl _rtld_bind /* Restore the registers saved by the plt code */ - ldp xzr, x30, [sp, #(5 * 16)] + ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)] /* Backup the address to branch to */ mov x16, x0 /* restore the arguments */ + ldp q6, q7, [sp], #32 + ldp q4, q5, [sp], #32 + ldp q2, q3, [sp], #32 + ldp q0, q1, [sp], #32 ldp x8, xzr, [sp], #16 ldp x6, x7, [sp], #16 ldp x4, x5, [sp], #16