From owner-svn-src-stable-11@freebsd.org Wed Apr 4 02:30:03 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C32AF873FB; Wed, 4 Apr 2018 02:30:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0B482DBA; Wed, 4 Apr 2018 02:30:01 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45D7C574B; Wed, 4 Apr 2018 02:30:01 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342U1j7063474; Wed, 4 Apr 2018 02:30:01 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342U1RD063473; Wed, 4 Apr 2018 02:30:01 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804040230.w342U1RD063473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 02:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331973 - stable/11/libexec/rtld-elf/aarch64 X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/libexec/rtld-elf/aarch64 X-SVN-Commit-Revision: 331973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 02:30:03 -0000 Author: mmel Date: Wed Apr 4 02:30:00 2018 New Revision: 331973 URL: https://svnweb.freebsd.org/changeset/base/331973 Log: MFC r330073: Make rtld_bind_start() debugger friendly. Save link register and annotate call frame structure so debugger can unwind call frame created by rtld_bind_start(). Modified: stable/11/libexec/rtld-elf/aarch64/rtld_start.S Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/aarch64/rtld_start.S ============================================================================== --- stable/11/libexec/rtld-elf/aarch64/rtld_start.S Wed Apr 4 02:22:56 2018 (r331972) +++ stable/11/libexec/rtld-elf/aarch64/rtld_start.S Wed Apr 4 02:30:00 2018 (r331973) @@ -55,7 +55,15 @@ END(.rtld_start) * x17 = &_rtld_bind_start */ ENTRY(_rtld_bind_start) + .cfi_startproc mov x17, sp + + /* Save frame pointer and SP */ + stp x29, x30, [sp, #-16]! + mov x29, sp + .cfi_def_cfa x29, 16 + .cfi_offset x30, -8 + .cfi_offset x29, -16 /* Save the arguments */ stp x0, x1, [sp, #-16]! @@ -84,9 +92,6 @@ ENTRY(_rtld_bind_start) /* Call into rtld */ bl _rtld_bind - /* Restore the registers saved by the plt code */ - ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)] - /* Backup the address to branch to */ mov x16, x0 @@ -100,11 +105,16 @@ ENTRY(_rtld_bind_start) ldp x4, x5, [sp], #16 ldp x2, x3, [sp], #16 ldp x0, x1, [sp], #16 - /* And the part of the stack the plt entry handled */ - add sp, sp, #16 + /* Restore frame pointer */ + ldp x29, xzr, [sp], #16 + + /* Restore link register saved by the plt code */ + ldp xzr, x30, [sp], #16 + /* Call into the correct function */ br x16 + .cfi_endproc END(_rtld_bind_start) /*