From patchwork Tue Jun 27 21:20:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Indu Bhagat X-Patchwork-Id: 113620 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8480497vqr; Tue, 27 Jun 2023 14:27:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7efbQxvh2WkB2oM4TCGXl7aIIzmednNywd6I3c2D+ciOaQz+JkXwjXRvrnKwptOP5fJcV0 X-Received: by 2002:a05:6402:34e:b0:51d:9b46:c638 with SMTP id r14-20020a056402034e00b0051d9b46c638mr6965741edw.2.1687901243769; Tue, 27 Jun 2023 14:27:23 -0700 (PDT) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q6-20020aa7da86000000b0051d7f9ef834si4198575eds.562.2023.06.27.14.27.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 14:27:23 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=cj6jCvPn; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B5CE5388B6AC for ; Tue, 27 Jun 2023 21:23:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B5CE5388B6AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687901026; bh=rb9EnGL8g4n9/9E+MISc94NA2GiLCthA5jypnZTQ8LE=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=cj6jCvPnNgTjWS0daqlX7WZEgSfmLOlO+SReb/AizV2QEW0LwltAWaAKKbmFcsrMe dZTe3rfK1baWH27uvJrG4oecjjyGnPfIbJgERkHyO/vxwXobUsNjRLYQxbtm9RFSLY ljqV3bhxD9v/wvaA95e9bP0z8S91iSZIvjVBE97I= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 6736638582AC for ; Tue, 27 Jun 2023 21:21:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6736638582AC Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35RJFJwl030685 for ; Tue, 27 Jun 2023 21:21:48 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdrca5v3q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jun 2023 21:21:48 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35RKlfVx013077 for ; Tue, 27 Jun 2023 21:21:47 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx5d1va-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jun 2023 21:21:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O5ov1Ys72W3IRr+P2mDmAT1Nb1/TUL9eiRMclwLW2ZIZyU/66ehmvAwc/6qzKZR6QZxhmgnC86AkiVrbZUPWNuTrdvED2YQnWhvMYR8Tbkfx/7cTDqyYfZYDoZAD/wPDpfQNYbOanlvRcXAsvbqPfVng0ge/td3iw01MvL/QwvzWZJ1UT2SLcCYCt8RNyDwNTAMhehV164dlUmcEpENT6t+L7mko/1EqAQb94+xB24zrIjhejW+IOmlzgEphwkGaliIsCWVlq92IQhhV75P8wCt7tbLcuE1/IwSFLMPMRHGBQIGAIK0PVVOhZ/PNqe9Fx30e7JQZJx8/f70ZnOVeyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rb9EnGL8g4n9/9E+MISc94NA2GiLCthA5jypnZTQ8LE=; b=EqJmdENQRw/cbrmynAdgR+MikldaAemsPm1CrF9Sozt2gbElSWjAz+rbFmvvWYDZs1S9XhJvFUvwXV7bqRXjzXcCmdxB8eYY/KPiD8zjL9PfaTkKj7IqVDGUX3Zg7sTJiyFqFTpNDWgVYyn2mOgR92deBxxyBxXFY/The1wb+8A1sL156qhzcYiL+H1mL31JJBpJvJ9ZqtyOdI60/ZQ3GVJ/hTzjKd6elx6zlbWBmuA7xuJBoZjGKnlG/d7WCoR/QLE0HtU04zXkZNGfaJTKvtnRLbIwMiwhcN9MjV620mSpmwv5nIzMbZ0LmYtk+JQ0JfYBY2Xe41hXrdsMU0zeSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by MW5PR10MB5807.namprd10.prod.outlook.com (2603:10b6:303:19a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Tue, 27 Jun 2023 21:21:45 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fdbb:b921:1ef:2d44]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fdbb:b921:1ef:2d44%4]) with mapi id 15.20.6521.026; Tue, 27 Jun 2023 21:21:45 +0000 To: binutils@sourceware.org Cc: Indu Bhagat Subject: [PATCH 11/12] doc: sframe: add details about alignment in the SFrame format Date: Tue, 27 Jun 2023 14:20:27 -0700 Message-Id: <20230627212028.2138604-12-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627212028.2138604-1-indu.bhagat@oracle.com> References: <20230627212028.2138604-1-indu.bhagat@oracle.com> X-ClientProxiedBy: MW4PR04CA0291.namprd04.prod.outlook.com (2603:10b6:303:89::26) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|MW5PR10MB5807:EE_ X-MS-Office365-Filtering-Correlation-Id: 88430693-7554-4c89-0434-08db7754828a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u9QBVa793uDOe49XCt5YwHW3LqM7gDmKSJbkS5J5U34H4lfhZRZbFfvglWv8twmzWsHOQwnKUEU4ZrWWLj/O4gOPezOuM1vKqobqVhSvJlxRvhHse8IBcKy8DHH5srhzV+ngMHwFi7ZjL9REnb07tlW3dPrbWWYGBpzGc4byrebTxR3p3BKT1laz6oF4i69yAhDerH8aGQ+HGAqJR12MXmmDWWfAjF2hGgrttNVda5NJjbsuzKNIF25PvC74rrMYsSxZj9+5qRYESRB7rX6a3O6i/nrHEL+/Lg78Nh+vs2A4T9maUSKZfsjMuM58UouuyK683rxB0HOIh+Fk0Ooc0uSS7NqGzTVA9v6YsVJzbkTIceotJXT7RsqiGpoRWoJVLs6i+v540+vKKYm/0sfQu4aCTuLq/NQi+JqVvJ80qEkw5p2kgC7uQT+iKXxiKAreqoAECcDil1MoG30h33KXD2e6QNsSUPe27sItl9rX8XYf5RQxKIsd1qaBpXsnC43Moiyhq/h+mAj5PWnE+lpzbwvmdVom/07BkigrNOAVSlvY/oz8x0vCM4tx2ptEB2UB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2158.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(366004)(136003)(376002)(39860400002)(346002)(451199021)(2906002)(6666004)(6486002)(83380400001)(107886003)(38100700002)(186003)(6512007)(6506007)(1076003)(2616005)(86362001)(41300700001)(478600001)(66476007)(316002)(36756003)(4326008)(66946007)(6916009)(8936002)(66556008)(26005)(44832011)(8676002)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 00ZksN13J7ZSod4jm5tLjJpzxS9ZhU/SCBGwf19agfqr1NiC4qlFsAo2QuJBsiMa7ObzqgKnp+6i5lTicVCvsJ16zFki8JLKN3HnPdKK1ZMaJGPG21ZwToWHCmO5KpwL4xrxJmae7wd5HVIdhiRMM+guwE5hLYY5O8/CFmpcwnL1guEiFr8mfkawnGvEze4H1MSRrRgUK4HuuGch3C6HEUCwXa4T3uIh0usNMlJ/4KdtEAI2mh7AwzDqLl/GTwBkMO3dQxoNLY31bBvOFiAwPOaPlHz8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ZjI16MT+ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88430693-7554-4c89-0434-08db7754828a X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2023 21:21:45.5787 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OH2lcXDk34fPaViFbC0urbCfJJwLIlgJWW2tDb6+glvPtgOplEk5bbZx7SxzfyTvUzhBlnto7JpsBWiDv3uAng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR10MB5807 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-27_14,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306270194 X-Proofpoint-ORIG-GUID: lZnwl2k8SbrmLYXF9Q791w4kKEMOr4fa X-Proofpoint-GUID: lZnwl2k8SbrmLYXF9Q791w4kKEMOr4fa X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Indu Bhagat via Binutils From: Indu Bhagat Reply-To: Indu Bhagat Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769892734268902957?= X-GMAIL-MSGID: =?utf-8?q?1769892734268902957?= A portion of the SFrame stack trace format has an unaligned on-disk representation. Add description at relevant points in the specification to clarify the alignment related details. --- libsframe/doc/sframe-spec.texi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libsframe/doc/sframe-spec.texi b/libsframe/doc/sframe-spec.texi index 68f465e2aa7..8a59aa76f52 100644 --- a/libsframe/doc/sframe-spec.texi +++ b/libsframe/doc/sframe-spec.texi @@ -77,6 +77,11 @@ a new segment of its own, PT_GNU_SFRAME. The SFrame format is currently supported only for select ABIs, namely, AMD64 and AAPCS64. +A portion of the SFrame format follows an unaligned on-disk representation. +Some data structures, however, (namely the SFrame header and the SFrame +function descriptor entry) have elements at their natural boundaries. All data +structures are packed, unless otherwise stated. + The contents of the SFrame section are stored in the target endianness, i.e., in the endianness of the system on which the section is targetted to be used. An SFrame section reader may use the magic number in the SFrame header to @@ -147,6 +152,8 @@ typedef struct sframe_preamble @} ATTRIBUTE_PACKED sframe_preamble; @end example +Every element of the SFrame preamble is naturally aligned. + All values are stored in the endianness of the target system for which the SFrame section is intended. Further details: @@ -258,6 +265,8 @@ typedef struct sframe_header @} ATTRIBUTE_PACKED sframe_header; @end example +Every element of the SFrame header is naturally aligned. + The sub-section offsets, namely @code{sfh_fdeoff} and @code{sfh_freoff}, in the SFrame header are relative to the @emph{end} of the SFrame header; they are each an offset in bytes into the SFrame section where the SFrame FDE @@ -384,6 +393,8 @@ typedef struct sframe_func_desc_entry @} ATTRIBUTE_PACKED sframe_func_desc_entry; @end example +Every element of the SFrame function descriptor entry is naturally aligned. + @code{sfde_func_start_fre_off} is the offset to the first SFrame FRE for the function. This offset is relative to the @emph{end of the SFrame FDE} sub-section (unlike the offsets in the SFrame header, which are relative to the @@ -608,6 +619,11 @@ typedef struct sframe_frame_row_entry_addr4 @} ATTRIBUTE_PACKED sframe_frame_row_entry_addr4; @end example +For ensuring compactness, SFrame frame row entries are stored unaligned on +disk. Appropriate mechanisms need to be employed, as necessary, by the +serializing and deserializing entities, if unaligned accesses need to be +avoided. + @code{sfre_start_address} is an unsigned 8-bit/16-bit/32-bit integral field identifies the start address of the range of program counters, for which the SFrame FRE applies. The value encoded in the @code{sfre_start_address} field