From nobody Fri Jul 07 16:56:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QyKKv399tz4m4Kt; Fri, 7 Jul 2023 16:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QyKKv164Nz4SVh; Fri, 7 Jul 2023 16:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DS/pxMeixJ6vpCo1AG7Dzu+Fl9adO9ab5FBAg5etT6M=; b=kAoeCo9g6RfXxqUYOslBjzGofFhP805TOf4H1n3aZgrFhgTE89XL1JnigaaYDAnjDvUQhj Rvduk3Eg16sUzMB1L1fT6x5Y9in/Qv13RaetPGnrISjmA7Wj/yyfrzFAt68VUby9/VvxGt ETmLhMVPgBW62Ua/lfCYXJwQQRj14sHQRKnvwkyMT7ZdyA/d49hMhb8aB98cm8CuSaBRGf MeJN6lATxoSFal0+Uc99nNb3Ai5f4p+2QMEI3oE1plHtqLErc9IOB8oVtLQiCFJZyUh4IH DniA52zb5azF2VhBlgInOZBYDjbQtnJQtSqtX2wz2B1ns44I+JIHNi7DUY0j+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DS/pxMeixJ6vpCo1AG7Dzu+Fl9adO9ab5FBAg5etT6M=; b=k4rJubrxufXen4eh02Nq+CWZpVr5UlzZTQgl0785cPnHT9wU5VPLAA/+nvYyqyKoixxA7U MTjuVeZuUqV7dklPRO55GuvNXkwCDYTMkqb7Jm9ndAqYCC+c7/+lbA7QWrWURPRks+bDFH F/nTjRWessuuArCmqFZLt7HQWqQ0z9umLFv9TZz2tQUlI/MKsKuP2Wp1qeaWHu9v8XYLN1 XxdNWrwJUW9a8sSZcDhNUUAVEOXKAP33S8h270i/P9ncIHoicCg8XhPKs2cufcVeqfvoeU 5sz9d8fSs2ZwB27jK8Ozb0cp7icK/h26uqAd373upSTR1O1bRNdpHBfiEge5iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688748979; a=rsa-sha256; cv=none; b=tK+M7vin5cVwu7zazMgZChjv7kYQ0FoRV8RH6VQ/BlkvaPRHvqTySydSsvXrtjeEc6vwRz ST5EV3xkrKgJdZPh+SF0Ewo1F8IyA0E1SJeYOT14Q0h7VduSPJrFyNRKcXFmceH7C8LrmC Y2ieZL9tjUl4qTjElibpIRRpq3IFMPYp3ly9JbeHFOUC8Gc0Lb9kEdAHGx9rUmca+f1AR/ U+/+KGryc9FVkLUaF2S4la3zwWeDznAeSp9uRFLVu4Jl72WmO1hnpDuwUl9wJBC+aFntdo HDUDLV4yjjX1b9inO1+fwygeEksqJ70V61Kho5TOaVeuG9ZZzThIMl+BgY0Dkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QyKKv09H8zmfX; Fri, 7 Jul 2023 16:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 367GuIZi013817; Fri, 7 Jul 2023 16:56:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 367GuI1i013816; Fri, 7 Jul 2023 16:56:18 GMT (envelope-from git) Date: Fri, 7 Jul 2023 16:56:18 GMT Message-Id: <202307071656.367GuI1i013816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 43e29d03f416 - main - csu: Add the prologue and epilogue to the _init and _fini on aarch64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43e29d03f416d7dda52112a29600a7c82ee1a91e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=43e29d03f416d7dda52112a29600a7c82ee1a91e commit 43e29d03f416d7dda52112a29600a7c82ee1a91e Author: Dmitry Chagin AuthorDate: 2023-07-07 16:54:53 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-07 16:54:53 +0000 csu: Add the prologue and epilogue to the _init and _fini on aarch64 Normally, modern unwinders uses Dwarf information to unwind stack, however in case when the code is not annotated by Dwarf instructions, unwinders fallbacks to a frame-pointer based algorithm. That is allows libunwind to unwind stack from global constructors and destructors. Also it makes gdb happy as it printed nonexistent frame before. Reviewed by: Differential Revision: https://reviews.freebsd.org/D40842 --- lib/csu/aarch64/crti.S | 8 ++++---- lib/csu/aarch64/crtn.S | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/csu/aarch64/crti.S b/lib/csu/aarch64/crti.S index 13e3b74642d8..af10c0f00d7d 100644 --- a/lib/csu/aarch64/crti.S +++ b/lib/csu/aarch64/crti.S @@ -35,14 +35,14 @@ __FBSDID("$FreeBSD$"); .globl _init .type _init,@function _init: - sub sp, sp, #16 - str lr, [sp] + stp x29, x30, [sp, #-16]! + mov x29, sp .section .fini,"ax",@progbits .align 4 .globl _fini .type _fini,@function _fini: - sub sp, sp, #16 - str lr, [sp] + stp x29, x30, [sp, #-16]! + mov x29, sp diff --git a/lib/csu/aarch64/crtn.S b/lib/csu/aarch64/crtn.S index ebb59b710412..c62433537f36 100644 --- a/lib/csu/aarch64/crtn.S +++ b/lib/csu/aarch64/crtn.S @@ -31,14 +31,12 @@ __FBSDID("$FreeBSD$"); .section .init,"ax",@progbits - ldr lr, [sp] - add sp, sp, #16 + ldp x29, x30, [sp], #16 ret .section .fini,"ax",@progbits - ldr lr, [sp] - add sp, sp, #16 + ldp x29, x30, [sp], #16 ret .section .note.GNU-stack,"",%progbits