From patchwork Thu Feb 22 16:01:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204839 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp35001dyb; Thu, 22 Feb 2024 08:01:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVGR5rwPh1VZs5XMiPESnPq2DB2lpfqyFqADGODHzmU2qWyTl9dHklKsrtbpV6mhWS9ttWbhg0Nv+VBSL7qAaSRGpfceQ== X-Google-Smtp-Source: AGHT+IH5lNd3H0/cKsoDkLBXxxouGjC0dOg/Ncc15vHfdwKYtMWk5YvG+nZfYVlaAcc4N6tAqivD X-Received: by 2002:a05:600c:45c9:b0:412:7b4d:b22a with SMTP id s9-20020a05600c45c900b004127b4db22amr1993858wmo.19.1708617718576; Thu, 22 Feb 2024 08:01:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617718; cv=pass; d=google.com; s=arc-20160816; b=vEg99IXIV3vz9vow4hRla/Z60IICpUXbci9FOyNYwTp2lhafiI4JK7Y5it3PMqEnGe hYjMuYlZm82EmOQfr75yA02v2BPxBHYqEN413JKsd5SfKTjvyKBsqP1WzpXP/IBh/oea 9usg4nLfSY38V56Hup8jj7zgEbUWCrcqOrF5dXTXbRIIZMcUaZjcpWVdNne+LMBCMYNQ DjNPh3/ZnHyTpTOQ6mNo8LRWY9D97Rjy8FyCCt7aFo7o5RG6bLnLp78WCLM1Mw9agmMV smEpOKxRP8k6/vMCRRqPPHownE4D7MmS5858CRRab1kputfqwQWy7PkeI5sARAPviYrT SmxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=Ad8xJAzqS1DPoYRKJ6LuMwtTTIxsdGFgYnVjfBJItFY=; fh=vTbGg4wY0rLaolKO+EtTu7rlJzNAP3iHbUH+MVoijcQ=; b=a7xJM84IgBD6/GgH3I2po3V4iaIFnnN20/iQW8qtBk1Ibg3MZ3DI37y0iTzPA02/BG p9rh04LOMvExp5gF//BaxKIVezM8qEAWUIEJnmt0JOse3zIcO4ZFE5ihB1yFfyOB2YUm TRM5v/Un9cfAVvO5n1AlDG6fbdHVM0pPOdSIDnGsYXy1W3DVS4U0DbIaecwKj4IPPDss b6ZDeFZSSRpZOHBkJkUmmtGDfcXCsUhU1AkH2V6kY5MYfcT4vhX8g0VvgVBUimFHEPhf oypnsWPF4stLPR0qSJEAEfTMa4HdAd16Lzaoi28IKI7t0F7rvo6dgBPeF8I5a3RVHTz/ gD0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YiVUixVq; arc=pass (i=1); 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s8-20020a05600c384800b00412898682adsi673866wmr.135.2024.02.22.08.01.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:01:58 -0800 (PST) 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=@ibm.com header.s=pp1 header.b=YiVUixVq; arc=pass (i=1); 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A4403858282 for ; Thu, 22 Feb 2024 16:01:57 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 541013858D1E for ; Thu, 22 Feb 2024 16:01:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 541013858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 541013858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617708; cv=none; b=DZnDKvm1n4wwy00Jff+4jv0D365qPyplgNBCgOvSYGNpOvBa8FR1NJnnW4eLgW28GmzybhMzwKWPrkoCnjHRNXsGJ0yGKx4vchnbH89puUr8ZyqOGQOxaI90/lttiQPeH4NJg+rM1KS8b6Q9JAQ3ZZqlsmiUPqQOx4p78+hUxg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617708; c=relaxed/simple; bh=glMSLSfLK8RNzTUsWI/VSdrueF7WjyT4C9QhmYh4Hv4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Uz2DsdiwGM4ZgVqAyGSsdmCnvWF9tuKFkDMat5/9uL2U9m4MwqFVrW5SF6NUwmU10neQyukiT+4NjCmoTUhwq3lftoRh0zFDKltp0K8fXvZk/QnNnMOVHPnHmEAcrBOOa4pwrew9aTlJPACbpjiCRcXCIwmhx+l3p8EmbP6WAL8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MFJ3aw018042; Thu, 22 Feb 2024 16:01:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=Ad8xJAzqS1DPoYRKJ6LuMwtTTIxsdGFgYnVjfBJItFY=; b=YiVUixVqDd8IgdJkGz2RkjxHpcCW++gur0EVRvaXzvdYOuVe9JPDviqR8OPshO5tPzxc F7CUYZR9I+jz04ibd0YS9ths2f2L3JH6TmcHdjvTwgm0Amza9isA1GugBR8jwc2PMtEQ o0z5gbza7B8N6GpfAEBQQuR1nrAQDEaqk/GB0Vuw5GpQasz/He9vc4EcI4wo3fIHmWbk s0QZMB814apqm1OFIZHklq+qkXjU1vNLW5Gn/gj5jbKmB2stqwOBjnov0dJ+Wa4ou3Sj Il8wYsufA3hdUt7wmN5WjxsD35vRhMkfgIofHwGK9QrRyHN3OOZp2dZECdaZt1TPzsSU sg== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we8t3139h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:35 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41MDSZht031117; Thu, 22 Feb 2024 16:01:34 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb9bm6skj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:34 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41MG1S5P6161138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:30 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9C8B20067; Thu, 22 Feb 2024 16:01:26 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 829A62006E; Thu, 22 Feb 2024 16:01:26 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 22 Feb 2024 16:01:26 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Indu Bhagat Cc: Jens Remus , Andreas Krebbel Subject: [PATCH 4/9] readelf/objdump: Dump SFrame CFA fixed FP and RA offsets Date: Thu, 22 Feb 2024 17:01:18 +0100 Message-Id: <20240222160123.2554459-5-jremus@linux.ibm.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240222160123.2554459-1-jremus@linux.ibm.com> References: <20240222160123.2554459-1-jremus@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: d1mVqWef1o202vX2KQznpeRfB6MmxZEQ X-Proofpoint-ORIG-GUID: d1mVqWef1o202vX2KQznpeRfB6MmxZEQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_11,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 mlxscore=0 malwarescore=0 adultscore=0 clxscore=1015 spamscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402220127 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791615532636699760 X-GMAIL-MSGID: 1791615532636699760 The SFrame format allows architectures to specify fixed offsets from the CFA, if any, from which the frame pointer (FP) and/or return address (RA) may be recovered. These offsets are stored in the SFrame header. For instance the SFrame generation in the assembler for x86 AMD64 specifies a fixed offset from the CFA, from which the return address (RA) may be recovered. When dumping the SFrame header, for instance in readelf/objdump with option --sframe, do also dump the specified fixed offsets from the CFA, if any, from which the frame pointer (FP) and return address (RA) may be recovered. Update the common SFrame test case verification patterns to allow for the optional dumping of the CFA fixed FP/RA offsets. Update the x86- specific SFrame and SCFI test case verification patterns to require a CFA fixed RA offset of -8. libsframe: * sframe-dump.c: Dump CFA fixed FP and RA offsets. gas/testsuite/ * gas/cfi-sframe/cfi-sframe-common-1.d: Test for optional fixed FP and RA offsets. * gas/cfi-sframe/cfi-sframe-common-2.d: Likewise. * gas/cfi-sframe/cfi-sframe-common-3.d: Likewise. * gas/cfi-sframe/cfi-sframe-common-4.d: Likewise. * gas/cfi-sframe/cfi-sframe-common-5.d: Likewise. * gas/cfi-sframe/cfi-sframe-common-6.d: Likewise. * gas/cfi-sframe/cfi-sframe-common-7.d: Likewise. * gas/cfi-sframe/cfi-sframe-common-8.d: Likewise. * gas/cfi-sframe/cfi-sframe-x86_64-1.d: Test for fixed RA offset. * gas/cfi-sframe/common-empty-1.d: Test for optional fixed FP and RA offsets. * gas/cfi-sframe/common-empty-2.d: Likewise. * gas/cfi-sframe/common-empty-3.d: Likewise. * gas/scfi/x86_64/scfi-cfi-sections-1.d: Test for SFrame fixed RA offset. * gas/scfi/x86_64/scfi-dyn-stack-1.d: Likewise. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d | 2 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d | 1 + gas/testsuite/gas/cfi-sframe/common-empty-1.d | 2 ++ gas/testsuite/gas/cfi-sframe/common-empty-2.d | 2 ++ gas/testsuite/gas/cfi-sframe/common-empty-3.d | 2 ++ gas/testsuite/gas/scfi/x86_64/scfi-cfi-sections-1.d | 2 ++ gas/testsuite/gas/scfi/x86_64/scfi-dyn-stack-1.d | 2 ++ libsframe/sframe-dump.c | 10 ++++++++++ 15 files changed, 37 insertions(+) diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d index 32577f31860e..5f4ae00747de 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 1 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d index 3e3f74dbe424..ded8c450a942 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-2.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 1 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d index 6430d463a891..d23fd9790f63 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-3.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 1 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d index 319ff96cce2a..ca559bd0a029 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-4.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 3 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d index 82d34973ddde..ee82053e13db 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-5.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 3 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d index fe6917c70800..9d54b98552bf 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-6.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 3 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d index 39724d9cdf19..2b7fe3aec8f4 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-7.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 3 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d index c0a0e627fad9..d654e1d0bcd4 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-8.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 2 diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d index ae36c21b3b7c..c8b5e6adfea0 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-1.d @@ -8,6 +8,7 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE + CFA fixed RA offset: \-8 Num FDEs: 1 Num FREs: 4 diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-1.d b/gas/testsuite/gas/cfi-sframe/common-empty-1.d index b133b15b051d..125612ff841f 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-1.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-1.d @@ -9,6 +9,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 0 Num FREs: 0 diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-2.d b/gas/testsuite/gas/cfi-sframe/common-empty-2.d index c5bc8594f1b7..59328fc1033f 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-2.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-2.d @@ -9,6 +9,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 0 Num FREs: 0 diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-3.d b/gas/testsuite/gas/cfi-sframe/common-empty-3.d index df0b19ee1bd1..5914c620760d 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-3.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-3.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 0 Num FREs: 0 diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-cfi-sections-1.d b/gas/testsuite/gas/scfi/x86_64/scfi-cfi-sections-1.d index 5962980256c1..b0cf8f4f5212 100644 --- a/gas/testsuite/gas/scfi/x86_64/scfi-cfi-sections-1.d +++ b/gas/testsuite/gas/scfi/x86_64/scfi-cfi-sections-1.d @@ -8,6 +8,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 5 diff --git a/gas/testsuite/gas/scfi/x86_64/scfi-dyn-stack-1.d b/gas/testsuite/gas/scfi/x86_64/scfi-dyn-stack-1.d index b51546af1494..4a449957187b 100644 --- a/gas/testsuite/gas/scfi/x86_64/scfi-dyn-stack-1.d +++ b/gas/testsuite/gas/scfi/x86_64/scfi-dyn-stack-1.d @@ -9,6 +9,8 @@ Contents of the SFrame section .sframe: Version: SFRAME_VERSION_2 Flags: NONE +#? CFA fixed FP offset: \-?\d+ +#? CFA fixed RA offset: \-?\d+ Num FDEs: 1 Num FREs: 4 diff --git a/libsframe/sframe-dump.c b/libsframe/sframe-dump.c index 42a086a5691f..493d052ce91f 100644 --- a/libsframe/sframe-dump.c +++ b/libsframe/sframe-dump.c @@ -47,6 +47,8 @@ dump_sframe_header (sframe_decoder_ctx *sfd_ctx) uint8_t flags; char *flags_str; const char *ver_str = NULL; + int8_t cfa_fixed_fp_offset; + int8_t cfa_fixed_ra_offset; const sframe_header *header = &(sfd_ctx->sfd_header); /* Prepare SFrame section version string. */ @@ -82,12 +84,20 @@ dump_sframe_header (sframe_decoder_ctx *sfd_ctx) else strcpy (flags_str, "NONE"); + /* CFA fixed FP and RA offsets. */ + cfa_fixed_fp_offset = header->sfh_cfa_fixed_fp_offset; + cfa_fixed_ra_offset = header->sfh_cfa_fixed_ra_offset; + const char* subsec_name = "Header"; printf ("\n"); printf (" %s :\n", subsec_name); printf ("\n"); printf (" Version: %s\n", ver_str); printf (" Flags: %s\n", flags_str); + if (cfa_fixed_fp_offset != SFRAME_CFA_FIXED_FP_INVALID) + printf (" CFA fixed FP offset: %d\n", cfa_fixed_fp_offset); + if (cfa_fixed_ra_offset != SFRAME_CFA_FIXED_RA_INVALID) + printf (" CFA fixed RA offset: %d\n", cfa_fixed_ra_offset); printf (" Num FDEs: %d\n", sframe_decoder_get_num_fidx (sfd_ctx)); printf (" Num FREs: %d\n", header->sfh_num_fres);