From nobody Fri Jul 07 16:56:21 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 4QyKKx3l8Pz4m4C5; Fri, 7 Jul 2023 16:56:21 +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 4QyKKx2ngRz4Spx; Fri, 7 Jul 2023 16:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748981; 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=e6CyAPGGlQK8awn17s+vYTFuuVY6qBNw59NwfCubr8k=; b=KWzJSTUrYYCj5p7NOQ/Dkzw1RM1ohqEolCzZC4eBy0ZdzPbeWfKz93nlqPb3hDINw0C0Jq zl2Pcq3hSZaBtlpN8BKg0pdv+fb5rxqYAVQda0gg/EKrvkA7ddLdn5GxkliS1cuzKnVQaC neFFu0rgfE+sEtMzRFUaQqTHTtAGH9pY9yHRmpIYZU8185iDnjUzLnkR6xT6PhXZhb4GvQ 00s+9a7RWiU+bkD152AFm6dQsFzQtOnKmuWmQBEvfDNZJbys8pmkGPE2NB5znDHjYMMPS2 HVvGXgfdSSmUAvZhTHqMExRj/un0gTVkZ8Ofy6pAmitNAXk2TfDmge2BjjxzyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688748981; 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=e6CyAPGGlQK8awn17s+vYTFuuVY6qBNw59NwfCubr8k=; b=W6xZ8emdOO3UCuVdoSIzEsEy4GyIb1Ob6TU41s4PU063ZC7RBBOx2VKuAdXge6cO0pLWZU 33MeFBBzw3J+K0U3rKXA/XgGIp6B5IdznBuR9nqRy3XJvWpkAxgkJwq4jLGp/3NKCYJ28R uo0kpjTa+ASXt6KcvfOluqqTmRGF012b2BydrFAvWkmVqb3WPTS6fMwkGbAIGuwHscMOBd e+CLRDvRvjlm0KxYB1xCjeYieMxVlWdce367PS8hqYhK1b+j4aIomT/ChMJqAQ5LkLS/Rr ovz5MjoOZt3hdJXQSxv0AS5/WRLlpC8dz4gDmI/K9v5NcvaUM0j6/7t0s7FWhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688748981; a=rsa-sha256; cv=none; b=G55M7sIRMxa8y91D04psm8NMX/v8VjVqP9b5UwnFzYEeMdQph+ILycE+frvnsG5Hvs6QX1 EQy9a7pvcfz1dYWTpdwBSBMTp6jFkWstRBOFbjUc2EAcqeR1lZLipVcFlLhhg1NrILUjuC BI6fUfjANLA2a0qfH7jZLFii4Jwqpkl8xlNIo+GCQIM/NxXW7h/cnrl75kOtZUVeK/dVjj x48Tgs4NVdF5Tg3mXFigt+Dc/9qm9oHke67wcTooLOfExCwDeBHx17CUGDzNs/aG0mCePw K4mWfCSrN6J7/u6ntDbS61/3P+dNlLKWOKBvFgR1B4bTD78s6hvH9Elit9QMDg== 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 4QyKKx1svHzm08; Fri, 7 Jul 2023 16:56:21 +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 367GuLOD013862; Fri, 7 Jul 2023 16:56:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 367GuLEI013861; Fri, 7 Jul 2023 16:56:21 GMT (envelope-from git) Date: Fri, 7 Jul 2023 16:56:21 GMT Message-Id: <202307071656.367GuLEI013861@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: ac7759f54574 - main - rtld: Annotate .rtld_start on aarch64 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: ac7759f54574ceb9da48829fd09ea6545404bdc0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ac7759f54574ceb9da48829fd09ea6545404bdc0 commit ac7759f54574ceb9da48829fd09ea6545404bdc0 Author: Dmitry Chagin AuthorDate: 2023-07-07 16:55:28 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-07 16:55:28 +0000 rtld: Annotate .rtld_start on aarch64 1. Add a stop indicator to rtld_start to satisfy unwinders on aarch64: 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. 2. Add a proper annotations for CFA. That is allows gdb and libunwind successfully stop when unwinding stack from global constructors and destructors. Reviewed by: Differential Revision: https://reviews.freebsd.org/D40844 --- libexec/rtld-elf/aarch64/rtld_start.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/rtld-elf/aarch64/rtld_start.S b/libexec/rtld-elf/aarch64/rtld_start.S index 4f0bef0233b0..107920548432 100644 --- a/libexec/rtld-elf/aarch64/rtld_start.S +++ b/libexec/rtld-elf/aarch64/rtld_start.S @@ -31,15 +31,18 @@ __FBSDID("$FreeBSD$"); ENTRY(.rtld_start) + .cfi_undefined x30 mov x19, x0 /* Put ps_strings in a callee-saved register */ sub sp, sp, #16 /* Make room for obj_main & exit proc */ + .cfi_adjust_cfa_offset 16 mov x1, sp /* exit_proc */ add x2, x1, #8 /* obj_main */ bl _rtld /* Call the loader */ mov x8, x0 /* Backup the entry point */ ldp x2, x1, [sp], #16 /* Load cleanup, obj_main */ + .cfi_adjust_cfa_offset 0 mov x0, x19 /* Restore ps_strings */ br x8 /* Jump to the entry point */