From nobody Sat Jul 01 07:52:25 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 4QtPY56dn8z4kjyl; Sat, 1 Jul 2023 07:52:25 +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 4QtPY54DFDz3xlN; Sat, 1 Jul 2023 07:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688197945; 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=1vMEIjkGItdVBQdU+5Jk6vtvHai7hghaHf7wHZD2WNU=; b=pfV+qKVofYvHkR3cy8BNUMHUz+xj83g9rlclGmYtlx8Tvyaa4vMwW5mdeye3T9UPCD7irJ ZEz/Rj6YqfOpnUGoEMQjcTSyZXejK797x47hVytWImLMuhTT42u0ZQevdb6FK6Tit6uivJ V20aBivtTKq6rA9vSAXb2m77/hTiUgfeS7kWgWn3CicBsjTKgx+0YKUk0DF5TKf2tVCvqN kFSZ6O7/hkALUDRIAnIoMnOcX4/pG9z5kJW47eXgvGpW52ji7eZQgv6F9Aj5diJEs8S4vQ NXOM50IAcwgw13ACYx8G2uHqqnJqTB6OAK7w9a9tjUaR/uQDtvH0T7PM4C5VKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688197945; 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=1vMEIjkGItdVBQdU+5Jk6vtvHai7hghaHf7wHZD2WNU=; b=oBrfwpYB3JbGcaReFq0TXBJOVY+SkOV8hixSAZZYX+AZskXM8IfYEiH/bwGdBMUW1O3mtm SVjpI7qFnf69NJlNYv7dW2LxWsXNWuX1Fi8oa6YsC9cPM7Wy1CoPiOn/Vt607qcChfFNda On3l3wT9BAk8u+PMPB9hmfYSk+tjCG+TQG6EE5DIn7edI9JufuVqzIFd1YyJj6K5O2hb9a wgdqmt6pWLoPqjgqRRpB0jZ1lzjhmt8iVmza/uSj8p2N9BlouI9a4C4xToudD5yaKxJ13b cTPaTRvTgYeFFqkfxcMl7N4uaAVzAnB5JU34V6wOPSdiOi8Sw5nFEgLp8UEC8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688197945; a=rsa-sha256; cv=none; b=Bv4KMtFh9sau+p4ILJGvwfPjQ5xD1Vsg3e2ERPhIPZRwVZcJqo0TOjnnXmPox5rHd9eAYv xB42rXuwXZQPGo43L1TQtayGD94AmBjFPWSSQZw2nIQ0zb7st1HtUbeZwiV0p7g9sm4UUx vdKAogCOaW7ohhmQt3B7xGfj33Q1KJPh0nGGmN+IKJsqUtCdJWpDXe8iI6lX8KHZD2sl/W jUXJeq0tlC+z8io8BjJRacE7arHaAOIOWC8NyZH77uSRByrAZ0NNdscApHJ54D+pKVnjdc XnDiQQD4RUn3Pvb8AytMsmlcvTP7WW5Y1ArNVN8tQBDFSgMixvGRsxIEdOikAA== 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 4QtPY52LMszHL0; Sat, 1 Jul 2023 07:52:25 +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 3617qP0g023831; Sat, 1 Jul 2023 07:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3617qPnQ023830; Sat, 1 Jul 2023 07:52:25 GMT (envelope-from git) Date: Sat, 1 Jul 2023 07:52:25 GMT Message-Id: <202307010752.3617qPnQ023830@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: f049c92ad6c3 - main - csu: Add the prologue and epilogue to the _init and _fini on x86_64 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: f049c92ad6c38ef42265956545897d8e3be1c228 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f049c92ad6c38ef42265956545897d8e3be1c228 commit f049c92ad6c38ef42265956545897d8e3be1c228 Author: Dmitry Chagin AuthorDate: 2023-07-01 07:52:10 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-01 07:52:10 +0000 csu: Add the prologue and epilogue to the _init and _fini on x86_64 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: kib Differential Revision: https://reviews.freebsd.org/D40795 --- lib/csu/amd64/crti.S | 6 ++++-- lib/csu/amd64/crtn.S | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/csu/amd64/crti.S b/lib/csu/amd64/crti.S index 618dca178877..05b8ad8a431a 100644 --- a/lib/csu/amd64/crti.S +++ b/lib/csu/amd64/crti.S @@ -31,13 +31,15 @@ __FBSDID("$FreeBSD$"); .globl _init .type _init,@function _init: - subq $8,%rsp + pushq %rbp + movq %rsp,%rbp .section .fini,"ax",@progbits .align 4 .globl _fini .type _fini,@function _fini: - subq $8,%rsp + pushq %rbp + movq %rsp,%rbp .section .note.GNU-stack,"",%progbits diff --git a/lib/csu/amd64/crtn.S b/lib/csu/amd64/crtn.S index c411f001ac1f..50b5003b9f7c 100644 --- a/lib/csu/amd64/crtn.S +++ b/lib/csu/amd64/crtn.S @@ -27,11 +27,11 @@ __FBSDID("$FreeBSD$"); .section .init,"ax",@progbits - addq $8,%rsp + popq %rbp ret .section .fini,"ax",@progbits - addq $8,%rsp + popq %rbp ret .section .note.GNU-stack,"",%progbits