From nobody Tue Jul 11 12:12:19 2023 X-Original-To: dev-commits-src-main@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 4R0frM6Hjpz2tnB1; Tue, 11 Jul 2023 12:12: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 4R0frM5cYwz3v4b; Tue, 11 Jul 2023 12:12:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689077539; 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=48PzJFhyKIey+nSJ6hLHIq22vXsq/utDH+k+AiLXY8k=; b=ceiVDPnW27ClbyG4ed9+bpa1HdwS+AIpPofL0Qx0w9kPy+1JBz4wxRtJjYc6aaDPN9pac/ cIPNZIA0JEC2M2bz0plTXOOMpEP5terjaPWOIJWa3PFdAp+PhMCtTcVFZDrFAih/hEq4Zn O8ZwG1p2SgM+DqYHIfkaQqbe5xlE2wOpK3lZJgnYYDw4wD74URT2egzPDmBkUuvw7SimNJ 10VXFVYnmw6eueqwofj6tEJEg5RpvN4cV9yj4MjesoNZf4Rol+0tJ4m0IB7SYsNO5qd+M4 x3RrlyCjHtYWCBCQVVsEd2DdeW+8U+U5jp5Wu40fCE9FyT3VS63JaFzMLpg8mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689077539; 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=48PzJFhyKIey+nSJ6hLHIq22vXsq/utDH+k+AiLXY8k=; b=SmgZcozO4Rk/jaLypx/+5rtXqSppMEB/PJUmL0hgNN6O8OWxuc0CF6lxw+LjhOCZp0eei7 NL5APG6GrJ699dsbq2lktprDTKM/HJvIVzToy7fd80rzJN2qWdRXL/vAFopG2kdd2O8RW8 Hjrut6WWH+ZfkBezaRHCO12YqGV3eIkXyZFT+IPTagcBmi9rSYwn39gZP03O768i+lqIJK qnrmuxoAcKGCz9aUZYOwa1n097k0qt+5ukFP8N1Y3uvO0DE969h0DLRylaDenGv/Z937AA BkLZwNopeBJsF0IpCoVRf1Naz/zliKkXIHdul/UegoInDp6plT9Bo6oBacrtMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689077539; a=rsa-sha256; cv=none; b=WUPRSMBRY93Hh6yJTJbhVJg7Q0hkQyPIOZhKUYNRRUreTUaqVtpxZzQwEeiS2r0tsAtjj3 zMajTcfly1TIfkbXfl+5f9jdqk4tpBjmYem2rya/qD//hCYwjwoysshDEoQE/U+kaC3iaw /aaM7IFwK37yewWK+Ry4VvT4AiEl9VWH8rzbO+bIER1RQyZC8tJpmLg3VsjCgZecPoKVRy su2f2TuoCTUnuSYTUFt7DFj6jt8au2jUtjVzZt0EjP+yhToOViJNetEuMzcMGkycm9X9xv qRdFDbu8daWb5M9dJBoZi2Hgkj888dEZoc/3+y3Z49boHVhMQv8rz9QkexXwEw== 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 4R0frM4dBpzQsq; Tue, 11 Jul 2023 12:12: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 36BCCJrX025126; Tue, 11 Jul 2023 12:12:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36BCCJWC025125; Tue, 11 Jul 2023 12:12:19 GMT (envelope-from git) Date: Tue, 11 Jul 2023 12:12:19 GMT Message-Id: <202307111212.36BCCJWC025125@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: d7e2580a1494 - main - csu: Add the prologue and epilogue to the _init and _fini on i386 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: d7e2580a1494a8a05d4a97fa472612df84c1539b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d7e2580a1494a8a05d4a97fa472612df84c1539b commit d7e2580a1494a8a05d4a97fa472612df84c1539b Author: Dmitry Chagin AuthorDate: 2023-07-11 12:11:22 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-11 12:11:22 +0000 csu: Add the prologue and epilogue to the _init and _fini on i386 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, imp Differential Revision: https://reviews.freebsd.org/D40948 --- lib/csu/i386/crti.S | 8 ++++++-- lib/csu/i386/crtn.S | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/csu/i386/crti.S b/lib/csu/i386/crti.S index 77e4e77722d7..f5883db0ba0f 100644 --- a/lib/csu/i386/crti.S +++ b/lib/csu/i386/crti.S @@ -31,13 +31,17 @@ __FBSDID("$FreeBSD$"); .globl _init .type _init,@function _init: - sub $12,%esp /* re-align stack pointer */ + pushl %ebp + movl %esp,%ebp + subl $8,%esp /* re-align stack pointer */ .section .fini,"ax",@progbits .align 4 .globl _fini .type _fini,@function _fini: - sub $12,%esp /* re-align stack pointer */ + pushl %ebp + movl %esp,%ebp + subl $8,%esp /* re-align stack pointer */ .section .note.GNU-stack,"",%progbits diff --git a/lib/csu/i386/crtn.S b/lib/csu/i386/crtn.S index 0264e22540f1..f223062bb787 100644 --- a/lib/csu/i386/crtn.S +++ b/lib/csu/i386/crtn.S @@ -27,11 +27,13 @@ __FBSDID("$FreeBSD$"); .section .init,"ax",@progbits - add $12,%esp + addl $8,%esp + popl %ebp ret .section .fini,"ax",@progbits - add $12,%esp + addl $8,%esp + popl %ebp ret .section .note.GNU-stack,"",%progbits