From nobody Tue Jul 11 12:12: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 4R0frL5DrWz2tnPB; Tue, 11 Jul 2023 12:12:18 +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 4R0frL4cC6z3v7S; Tue, 11 Jul 2023 12:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689077538; 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=l9uPsFQ1OYyI57eyNb4LrofBwyLk6xtL+VtVZ29fHx4=; b=DezEW1ppYB+RUuIezrCxigizqZdrMDRBwOVy0qEZFwKClVe4dDbtDkAGo11ADbiJckPSqa t64sQ7nhydyEqo98tcauAwm36kzk5ZkvUcLmiBBmIjXxNmNNh8sZ7gtTrl/ItCR4RpmCjp OCy3g+LwnIo8zdyvEHTkO4tHssZHI5GgDIMVLf2BgP5nhEOdcxoKKCOOFWnOupomn2oDri sYru1gLpj81dZ1Du/tvm2KUgXIXzy57ZFjIYfXwXusjoZ8F5yImC6bDmmCHkpa8CXe/AyA p9iFy/LtTyE9HJYp2xbEMvcl95BxLC5GD70rt6ggKblbC5n2PwvbOLfEIC0KCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689077538; 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=l9uPsFQ1OYyI57eyNb4LrofBwyLk6xtL+VtVZ29fHx4=; b=MjZtbNj/xMvy+vNW6ezeJqexAKnVHIXcQZYVHV6dDtuuCdDAwIpMJnV3W95ZYyqqQjSkIR RdGieKswBJRxJ6Zwnw6l0I5vSyMM9Q4tgIq9zkJLgMcQVGEnwnG5GlexT5MeZt6yWlaamV p6kVvR1tqjSbHIASNe1+JJOdvHulxooYBsd0IAwnjnnVoU/WE/8V++GJzXZjch1/aFskdD CPg9+WiJVK9C/V9szzzSGAMWyckKvSM0jIykKDcWL8ROyKrT5shRpfhuM3Ph/XAX/11N8a Uc+uD+lSyNzZF/+iVlE3EN2taxDvmxth7O7QKgYScUdhkDKi/Xt5DOvpL00JEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689077538; a=rsa-sha256; cv=none; b=p0xN1heEj/H+JP9Wjz0d8AiisTVON0UIz+7sJ4Inlh7iedn4pirBmL4ITfeRG+X0w0W7cn Qn5A9+EEROlXp7d8yHTy9iWKJa6JzPb+lUU74hGOHhNbmeAVX9D8wr3pP1YblbIloSuGeN +HEQeERK3NnATET8pY6ZOmi9MyXPa7hPdRTDrD16qBU5XQYwWW+Y6VTpaDuOaCsEB89qY2 i1IsG/lLUNC5DEQw+pb1xDFg8FOsdIf+JIoGU1DI1hqPH0rVUYTjYaEV2UBE8YjQ5nCqBl GPNzRifG1ztPgxT5DuiQc6B7qDCTmARM6ItaZ7venywSL6O9rY8xw/+QHyvYLw== 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 4R0frL3ht0zQyY; Tue, 11 Jul 2023 12:12:18 +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 36BCCIhc025107; Tue, 11 Jul 2023 12:12:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36BCCI9R025106; Tue, 11 Jul 2023 12:12:18 GMT (envelope-from git) Date: Tue, 11 Jul 2023 12:12:18 GMT Message-Id: <202307111212.36BCCI9R025106@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: e541cf8316bb - main - rtld: Annotate .rtld_start on i386 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: e541cf8316bb787df0f19c43132c517482cf24a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e541cf8316bb787df0f19c43132c517482cf24a6 commit e541cf8316bb787df0f19c43132c517482cf24a6 Author: Dmitry Chagin AuthorDate: 2023-07-11 12:10:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-11 12:10:32 +0000 rtld: Annotate .rtld_start on i386 Add a stop indicator to rtld_start to satisfy unwinders: The right unwinding stop indicator should be CFI-undefined PC. https://dwarfstd.org/doc/Dwarf3.pdf - page 118: If a Return Address register is defined in the virtual unwind table, and its rule is undefined (for example, by DW_CFA_undefined), then there is no return address and no call address, and the virtual unwind of stack activations is complete. That is allows gdb and libunwind successfully stop when unwinding stack from global constructors and destructors. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40949 --- libexec/rtld-elf/i386/rtld_start.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libexec/rtld-elf/i386/rtld_start.S b/libexec/rtld-elf/i386/rtld_start.S index 6dbae220d89c..656ebb13864f 100644 --- a/libexec/rtld-elf/i386/rtld_start.S +++ b/libexec/rtld-elf/i386/rtld_start.S @@ -30,8 +30,15 @@ .globl .rtld_start .type .rtld_start,@function .rtld_start: + .cfi_startproc + .cfi_undefined %eip xorl %ebp,%ebp # Clear frame pointer for good form movl %esp,%esi # Save initial stack pointer + pushl %ebp + .cfi_def_cfa_offset 4 + movl %esp,%ebp + .cfi_offset %ebp,-4 + .cfi_def_cfa_register %ebp andl $0xfffffff0,%esp # Align stack pointer subl $16,%esp # A place to store exit procedure addr movl %esp,%ebx # save address of exit proc @@ -53,6 +60,7 @@ .globl .rtld_goto_main .rtld_goto_main: # This symbol exists just to make debugging easier. jmp *%eax # Enter main program + .cfi_endproc /*