From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 370513858D3C for ; Fri, 9 Jun 2023 19:28:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 370513858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 359I292J009051 for ; Fri, 9 Jun 2023 19:28:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=vxYJS/CJH7A0Ud9efIVmacJpSbloqe8MOIBMqhJA1Lk=; b=XWq5GKKySUlgQDztI3XxObLgsPq0YdG8BrTWzcx8qEU3A9FO1LwiL6uUrleyrQv0mLNt 9CQ93lUJGSxIPzkc+jzYdfQDBhbB2NTOCfCD1hlAtp0pFa2/H2EsuztYiE9aVL20NWg3 n/rel84RWAz9yKF+j4CTshNuid+z/wmk5M3ch7H6H6K1HzBVXe2CK+m3D2Bvs5QV6ePe cwHu9tinFGLArCPmOEFKjO7R/aRnAy1WJEZ4+XFIraS3jDWt0/gOaEZ1AblJRGmJu4p3 agxWOku1c5uEj/uD/4gifC4iRzXjSYSsojnnnasNLo3sZeuIVz6Q3uABLTHJYzX/2tam Pg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6uygpe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 09 Jun 2023 19:28:34 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 359IZ0DG010513 for ; Fri, 9 Jun 2023 19:28:33 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2048.outbound.protection.outlook.com [104.47.73.48]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6tkgbd-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 09 Jun 2023 19:28:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WE5hTp1+pO9lMvm772DvU+Yufw5pQoomulsDS42OgnFjleC1LCfxFoHrVKgu1GVxADbrgG+CNOsQzYNDf/nHtEGA7XOfJZXLlkaHFQ+4M2PA6dlvLVLGXCJ2LC0UU0Bm/sEQz6VWDGbYP4+C3ZFExRXSvl9lO3YPR5HEvzqJYMnENH0eQuVOYNehm6peDxwa8jwElX7RmTvU/vkM0x704ErLXYSEeJfDDWlXR5WXX1/XGR2ov+BO2jtiAO+bFezn4vBvL61iB/oDvWXIdGp39BMtEFg4cty8xVQQGAFVIS3z6UZ33TVrLnBKSwwSURS1e1FwaGfXg8NB4RevbjPfHQ== 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=vxYJS/CJH7A0Ud9efIVmacJpSbloqe8MOIBMqhJA1Lk=; b=nh+HbGjXupta61f/RK2uqMaCw95URtpbEsy+URWFxWDsbe1KSG5OD6n6TEleJguqhmXH3miYvDUUGEZtXNgB0r9ccCd6Rh7cwRbLQgqLy6zzuH7I62SmW7YP1KNqxIeB7wbdeDe0VIM0mb5ropzvocsg5NQnStVAA7+yLX/mgLthYRoeLIV01voTeHyMKHr2mBCsM6VPV/p7//2AW7XXnwG1oexxnr/zKKgwLjNarrJtD/ZkEJo8Ro9shfrKqOgIflr8QOXUguB5aZaYXdpUwIxYuFK1/6qDEAJqSr/OG+UVxPb3gb2KWtpjlBOXwCHySzT5Aw+YRu9ZWru5hnPX2g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vxYJS/CJH7A0Ud9efIVmacJpSbloqe8MOIBMqhJA1Lk=; b=vYHEGA4V8BpaZ9B2U2odFDmOQNxT1yvh/PJW9srBgZtvApQCYnvXTFMqh3EMroo6l9kvs0K+UIH+1KdqfEw4JdTzYiFmnORbC9gbXL80Y2sZzMosw0/rf6kT3LOK/Ph4owN3E60IFi7U2m0ezShWxiTJcaJutBPu1E6eQeHhkl8= Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by MN6PR10MB7423.namprd10.prod.outlook.com (2603:10b6:208:46c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.27; Fri, 9 Jun 2023 19:28:30 +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.6455.028; Fri, 9 Jun 2023 19:28:30 +0000 From: Indu Bhagat To: binutils@sourceware.org Cc: Indu Bhagat Subject: [COMMITTED] libsframe: testsuite: add sframe_find_fre tests for pltN entries Date: Fri, 9 Jun 2023 12:28:22 -0700 Message-Id: <20230609192822.2471957-2-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230609192822.2471957-1-indu.bhagat@oracle.com> References: <20230609192822.2471957-1-indu.bhagat@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR04CA0125.namprd04.prod.outlook.com (2603:10b6:303:84::10) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|MN6PR10MB7423:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a9e8a21-6545-412a-cd63-08db691fb4ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KNgkCyENp0pq4JCDdD204Ae56OdasLGbnT5E5yYKhQ8SE2p7gXRDdgaBavvzu6wT2V/5FOpxMTJ3t6e/yRbo/HWWQOgC4TS9sFV7jtUb7YeILdXtw+NhfxwYoTKraBV6GDycGhODt80EKb2UiRzXEd722kC4APNslCLzz/VQUeQafbiaC4nifCf8YxCen5C4aHONLxeGLkq4ApQzRf8KCOq4pXxZ1bymjHFViKgt4zTJu4UVOQTNNsK72IXbWUt0q6giR/awn0m7F4nOKGKTbrelST7G8Mkg2/5n23U5FKhp8qxseSb+nZkxCwbJZTtiPMjUBgHT+lr574bIM6zJJEcznb5yNRoPMcmwPoUEIAQSqkuhzyMvX7Efh7z7I/uPgNXsrQ2Ey+/Zfj9l0bGaqM/USgocAPNTSjcRaLrIKMU0Wz49QLIcD700BWlCGagr5+QCAm8VLke1FpYmX5cUZQ+Sr/1EXo/61Y+cHnbofl+caSuGFPjxmhIbh4H0OqKSrchwrWL6SHWoblP/8FYon1w1g9wWlFQwAVYnpr2SS3Ir2HH+z7YguRY6jdZ+bYpx8z07A9mWGQg6HtEHDCudDA== 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)(39860400002)(366004)(346002)(376002)(136003)(396003)(451199021)(36756003)(1076003)(26005)(5660300002)(107886003)(186003)(6512007)(6506007)(41300700001)(8676002)(2616005)(8936002)(478600001)(4326008)(66946007)(83380400001)(66476007)(66556008)(6666004)(6486002)(30864003)(38100700002)(6916009)(2906002)(316002)(86362001)(44832011)(2004002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LCL4GRAdjcGpI+/t8Vn0U9NvqTfRsfvQV2/mX/fHKxo2p1TNzEf6/UXZVYhC?= =?us-ascii?Q?BsNrWo8Ek8L0VPJB7aCgk/5dOkHqOukGHX4KaRH7Vq84q7eKOZiFTslYVOLA?= =?us-ascii?Q?lJeR1f2dyfF5ChvLO0L4pC4anoQl095+wcYOm5wL5mvBMiunPL61nwsdXw0n?= =?us-ascii?Q?8SHAbp+04gsvZBIFAUA8hBiPGSdAzeXZjVDuic+oZ+Pl7k9HlsHt5Mn3z9j+?= =?us-ascii?Q?kQvUyBT1P5fcqCTQPlDV4+ijJUvUGP/pLPz2oRzuedxG8pEPUpocwq/8zn/R?= =?us-ascii?Q?WqhXo7RSR/ckM+WF/HIyOgm3aG3TcEVg0ccDCrS5mjKwtJhZYVUQNLx/9Ia4?= =?us-ascii?Q?wXJK5ke0zBKxQgBNt1TKLgaF9qH0Zozzs5ZHUkQ9GcafArBCO2d8WqxqEnBs?= =?us-ascii?Q?5/XRRZY7R+vIVKQinkGf6UfYGKksSD9NeZ5ePkArZmkSVNRFMQMLDFwvhuCX?= =?us-ascii?Q?tWPq6lEugKNzmogKf4zqu2mS5CD2leD7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Iju+fWKNN1xByEtYDAQgFyT X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a9e8a21-6545-412a-cd63-08db691fb4ff X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2023 19:28:30.7235 (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: KYQVMtYXgbDBY5/sWuxyDfmKlN0FpXvmKvmMl2BPjspbbyN/s6W3KmefB4zPMfV8d0TM1uWo+j46eVgGzhpsUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7423 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-09_14,2023-06-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306090163 X-Proofpoint-GUID: mbGnQg-D82H34UiSe-u_sl-LJ6YaodJQ X-Proofpoint-ORIG-GUID: mbGnQg-D82H34UiSe-u_sl-LJ6YaodJQ X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,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 List-Id: Add a new test plt-findfre-1 to ensure lookup of SFrame stack trace information for pltN entries is correct. In this test, a dummy SFrame FDE of type SFRAME_FDE_TYPE_PCMASK is created. The size of the 'function code block' covered by the SFrame FDE is equivalent to 5 pltN entries of 16 bytes each. The test first looks up SFrame FREs for some addresses in the first pltN entry, followed by lookups for some addresses in the fourth pltN entry. libsframe/ * Makefile.in: Regenerated. * testsuite/libsframe.find/find.exp: Add new test. * testsuite/libsframe.find/local.mk: Likewise. * testsuite/libsframe.find/plt-findfre-1.c: New test. --- libsframe/Makefile.in | 42 +++++- libsframe/testsuite/libsframe.find/find.exp | 5 + libsframe/testsuite/libsframe.find/local.mk | 6 +- .../testsuite/libsframe.find/plt-findfre-1.c | 127 ++++++++++++++++++ 4 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 libsframe/testsuite/libsframe.find/plt-findfre-1.c diff --git a/libsframe/Makefile.in b/libsframe/Makefile.in index 405bc04263d..c6a4cd56a9e 100644 --- a/libsframe/Makefile.in +++ b/libsframe/Makefile.in @@ -116,7 +116,8 @@ check_PROGRAMS = $(am__EXEEXT_1) @HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.decode/frecnt-2 \ @HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.encode/encode-1 \ @HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/findfre-1 \ -@HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/findfunc-1 +@HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/findfunc-1 \ +@HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/plt-findfre-1 subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ @@ -186,7 +187,8 @@ am__v_lt_1 = @HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.decode/frecnt-2$(EXEEXT) \ @HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.encode/encode-1$(EXEEXT) \ @HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/findfre-1$(EXEEXT) \ -@HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/findfunc-1$(EXEEXT) +@HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/findfunc-1$(EXEEXT) \ +@HAVE_COMPAT_DEJAGNU_TRUE@ testsuite/libsframe.find/plt-findfre-1$(EXEEXT) am__dirstamp = $(am__leading_dot)dirstamp am_testsuite_libsframe_decode_be_flipping_OBJECTS = testsuite/libsframe.decode/testsuite_libsframe_decode_be_flipping-be-flipping.$(OBJEXT) testsuite_libsframe_decode_be_flipping_OBJECTS = \ @@ -218,6 +220,11 @@ testsuite_libsframe_find_findfunc_1_OBJECTS = \ $(am_testsuite_libsframe_find_findfunc_1_OBJECTS) testsuite_libsframe_find_findfunc_1_DEPENDENCIES = \ ${top_builddir}/libsframe.la +am_testsuite_libsframe_find_plt_findfre_1_OBJECTS = testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.$(OBJEXT) +testsuite_libsframe_find_plt_findfre_1_OBJECTS = \ + $(am_testsuite_libsframe_find_plt_findfre_1_OBJECTS) +testsuite_libsframe_find_plt_findfre_1_DEPENDENCIES = \ + ${top_builddir}/libsframe.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -258,14 +265,16 @@ SOURCES = $(libsframe_la_SOURCES) \ $(testsuite_libsframe_decode_frecnt_2_SOURCES) \ $(testsuite_libsframe_encode_encode_1_SOURCES) \ $(testsuite_libsframe_find_findfre_1_SOURCES) \ - $(testsuite_libsframe_find_findfunc_1_SOURCES) + $(testsuite_libsframe_find_findfunc_1_SOURCES) \ + $(testsuite_libsframe_find_plt_findfre_1_SOURCES) DIST_SOURCES = $(libsframe_la_SOURCES) \ $(testsuite_libsframe_decode_be_flipping_SOURCES) \ $(testsuite_libsframe_decode_frecnt_1_SOURCES) \ $(testsuite_libsframe_decode_frecnt_2_SOURCES) \ $(testsuite_libsframe_encode_encode_1_SOURCES) \ $(testsuite_libsframe_find_findfre_1_SOURCES) \ - $(testsuite_libsframe_find_findfunc_1_SOURCES) + $(testsuite_libsframe_find_findfunc_1_SOURCES) \ + $(testsuite_libsframe_find_plt_findfre_1_SOURCES) AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; @@ -540,6 +549,9 @@ testsuite_libsframe_find_findfre_1_CPPFLAGS = -I${top_srcdir}/../include -Wall testsuite_libsframe_find_findfunc_1_SOURCES = testsuite/libsframe.find/findfunc-1.c testsuite_libsframe_find_findfunc_1_LDADD = ${top_builddir}/libsframe.la testsuite_libsframe_find_findfunc_1_CPPFLAGS = -I${top_srcdir}/../include -Wall +testsuite_libsframe_find_plt_findfre_1_SOURCES = testsuite/libsframe.find/plt-findfre-1.c +testsuite_libsframe_find_plt_findfre_1_LDADD = ${top_builddir}/libsframe.la +testsuite_libsframe_find_plt_findfre_1_CPPFLAGS = -I${top_srcdir}/../include -Wall all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -712,6 +724,13 @@ testsuite/libsframe.find/testsuite_libsframe_find_findfunc_1-findfunc-1.$(OBJEXT testsuite/libsframe.find/findfunc-1$(EXEEXT): $(testsuite_libsframe_find_findfunc_1_OBJECTS) $(testsuite_libsframe_find_findfunc_1_DEPENDENCIES) $(EXTRA_testsuite_libsframe_find_findfunc_1_DEPENDENCIES) testsuite/libsframe.find/$(am__dirstamp) @rm -f testsuite/libsframe.find/findfunc-1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(testsuite_libsframe_find_findfunc_1_OBJECTS) $(testsuite_libsframe_find_findfunc_1_LDADD) $(LIBS) +testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.$(OBJEXT): \ + testsuite/libsframe.find/$(am__dirstamp) \ + testsuite/libsframe.find/$(DEPDIR)/$(am__dirstamp) + +testsuite/libsframe.find/plt-findfre-1$(EXEEXT): $(testsuite_libsframe_find_plt_findfre_1_OBJECTS) $(testsuite_libsframe_find_plt_findfre_1_DEPENDENCIES) $(EXTRA_testsuite_libsframe_find_plt_findfre_1_DEPENDENCIES) testsuite/libsframe.find/$(am__dirstamp) + @rm -f testsuite/libsframe.find/plt-findfre-1$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(testsuite_libsframe_find_plt_findfre_1_OBJECTS) $(testsuite_libsframe_find_plt_findfre_1_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -731,6 +750,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@testsuite/libsframe.encode/$(DEPDIR)/testsuite_libsframe_encode_encode_1-encode-1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_findfre_1-findfre-1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_findfunc_1-findfunc-1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -861,6 +881,20 @@ testsuite/libsframe.find/testsuite_libsframe_find_findfunc_1-findfunc-1.obj: tes @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testsuite_libsframe_find_findfunc_1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o testsuite/libsframe.find/testsuite_libsframe_find_findfunc_1-findfunc-1.obj `if test -f 'testsuite/libsframe.find/findfunc-1.c'; then $(CYGPATH_W) 'testsuite/libsframe.find/findfunc-1.c'; else $(CYGPATH_W) '$(srcdir)/testsuite/libsframe.find/findfunc-1.c'; fi` +testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.o: testsuite/libsframe.find/plt-findfre-1.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testsuite_libsframe_find_plt_findfre_1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.o -MD -MP -MF testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.Tpo -c -o testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.o `test -f 'testsuite/libsframe.find/plt-findfre-1.c' || echo '$(srcdir)/'`testsuite/libsframe.find/plt-findfre-1.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.Tpo testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsuite/libsframe.find/plt-findfre-1.c' object='testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testsuite_libsframe_find_plt_findfre_1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.o `test -f 'testsuite/libsframe.find/plt-findfre-1.c' || echo '$(srcdir)/'`testsuite/libsframe.find/plt-findfre-1.c + +testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.obj: testsuite/libsframe.find/plt-findfre-1.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testsuite_libsframe_find_plt_findfre_1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.obj -MD -MP -MF testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.Tpo -c -o testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.obj `if test -f 'testsuite/libsframe.find/plt-findfre-1.c'; then $(CYGPATH_W) 'testsuite/libsframe.find/plt-findfre-1.c'; else $(CYGPATH_W) '$(srcdir)/testsuite/libsframe.find/plt-findfre-1.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.Tpo testsuite/libsframe.find/$(DEPDIR)/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsuite/libsframe.find/plt-findfre-1.c' object='testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testsuite_libsframe_find_plt_findfre_1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o testsuite/libsframe.find/testsuite_libsframe_find_plt_findfre_1-plt-findfre-1.obj `if test -f 'testsuite/libsframe.find/plt-findfre-1.c'; then $(CYGPATH_W) 'testsuite/libsframe.find/plt-findfre-1.c'; else $(CYGPATH_W) '$(srcdir)/testsuite/libsframe.find/plt-findfre-1.c'; fi` + mostlyclean-libtool: -rm -f *.lo diff --git a/libsframe/testsuite/libsframe.find/find.exp b/libsframe/testsuite/libsframe.find/find.exp index 05ac02ba60b..ce804907dd2 100644 --- a/libsframe/testsuite/libsframe.find/find.exp +++ b/libsframe/testsuite/libsframe.find/find.exp @@ -25,6 +25,7 @@ if [string equal $COMPAT_DEJAGNU "no"] { verbose -log "SFrame testsuite needs perhaps a more recent DejaGnu" unsupported findfre-1 unsupported findfunc-1 + unsupported plt-findfre-1 return; } @@ -35,3 +36,7 @@ if { [host_execute "testsuite/libsframe.find/findfre-1"] ne "" } { if { [host_execute "testsuite/libsframe.find/findfunc-1"] ne "" } { fail "findfunc-1" } + +if { [host_execute "testsuite/libsframe.find/plt-findfre-1"] ne "" } { + fail "plt-findfre-1" +} diff --git a/libsframe/testsuite/libsframe.find/local.mk b/libsframe/testsuite/libsframe.find/local.mk index e8e4fa8091e..03206b134d6 100644 --- a/libsframe/testsuite/libsframe.find/local.mk +++ b/libsframe/testsuite/libsframe.find/local.mk @@ -1,5 +1,5 @@ if HAVE_COMPAT_DEJAGNU - check_PROGRAMS += %D%/findfre-1 %D%/findfunc-1 + check_PROGRAMS += %D%/findfre-1 %D%/findfunc-1 %D%/plt-findfre-1 endif %C%_findfre_1_SOURCES = %D%/findfre-1.c @@ -9,3 +9,7 @@ endif %C%_findfunc_1_SOURCES = %D%/findfunc-1.c %C%_findfunc_1_LDADD = ${top_builddir}/libsframe.la %C%_findfunc_1_CPPFLAGS = -I${top_srcdir}/../include -Wall + +%C%_plt_findfre_1_SOURCES = %D%/plt-findfre-1.c +%C%_plt_findfre_1_LDADD = ${top_builddir}/libsframe.la +%C%_plt_findfre_1_CPPFLAGS = -I${top_srcdir}/../include -Wall diff --git a/libsframe/testsuite/libsframe.find/plt-findfre-1.c b/libsframe/testsuite/libsframe.find/plt-findfre-1.c new file mode 100644 index 00000000000..f6f4fd73d70 --- /dev/null +++ b/libsframe/testsuite/libsframe.find/plt-findfre-1.c @@ -0,0 +1,127 @@ +/* plt-findfre-1.c -- Test for sframe_find_fre for SFRAME_FDE_TYPE_PCMASK. + + Copyright (C) 2023 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include "config.h" + +#include +#include +#include + +#include "sframe-api.h" + +/* DejaGnu should not use gnulib's vsnprintf replacement here. */ +#undef vsnprintf +#include + +static int +add_plt_fde1 (sframe_encoder_ctx *ectx, int idx) +{ + int i, err; + /* A contiguous block containing 3 FREs. The start_ip_offset must remain + less than 16 bytes. */ + sframe_frame_row_entry fres[] + = { {0x0, {0x1, 0, 0}, 0x3}, + {0x6, {0x2, 0xf0, 0}, 0x5}, + {0xc, {0x3, 0xf0, 0}, 0x4} + }; + + unsigned char finfo = sframe_fde_create_func_info (SFRAME_FRE_TYPE_ADDR1, + SFRAME_FDE_TYPE_PCMASK); + /* 5 pltN entries of 16 bytes each. */ + err = sframe_encoder_add_funcdesc (ectx, 0x1000, 16*5, finfo, 3); + if (err == -1) + return err; + + for (i = 0; i < 3; i++) + if (sframe_encoder_add_fre (ectx, idx, fres+i) == SFRAME_ERR) + return -1; + + return 0; +} + +int main (void) +{ + sframe_encoder_ctx *ectx; + sframe_decoder_ctx *dctx; + sframe_frame_row_entry frep; + char *sframe_buf; + size_t sf_size; + int err = 0; + unsigned int fde_cnt = 0; + +#define TEST(name, cond) \ + do \ + { \ + if (cond) \ + pass (name); \ + else \ + fail (name); \ + } \ + while (0) + + ectx = sframe_encode (SFRAME_VERSION, 0, SFRAME_ABI_AMD64_ENDIAN_LITTLE, + SFRAME_CFA_FIXED_FP_INVALID, + -8, /* Fixed RA offset for AMD64. */ + &err); + + err = add_plt_fde1 (ectx, 0); + TEST ("plt-findfre-1: Adding FDE1 for plt", err == 0); + + fde_cnt = sframe_encoder_get_num_fidx (ectx); + TEST ("plt-findfre-1: Test FDE count", fde_cnt == 1); + + sframe_buf = sframe_encoder_write (ectx, &sf_size, &err); + TEST ("plt-findfre-1: Encoder write", err == 0); + + dctx = sframe_decode (sframe_buf, sf_size, &err); + TEST("plt-findfre-1: Decoder setup", dctx != NULL); + + /* Find the first FRE in PLT1. */ + err = sframe_find_fre (dctx, (0x1000 + 0x0), &frep); + TEST("plt-findfre-1: Find first FRE in PLT1", + ((err == 0) && (sframe_fre_get_cfa_offset (dctx, &frep, &err) == 0x1))); + + /* Find the second FRE. */ + err = sframe_find_fre (dctx, (0x1000 + 0x6), &frep); + TEST("plt-findfre-1: Find second FRE in PLT1", + ((err == 0) && (sframe_fre_get_cfa_offset (dctx, &frep, &err) == 0x2))); + + /* Find the last FRE. */ + err = sframe_find_fre (dctx, (0x1000 + 0xc), &frep); + TEST("plt-findfre-1: Find last FRE in PLT1", + ((err == 0) && (sframe_fre_get_cfa_offset (dctx, &frep, &err) == 0x3))); + + /* Find the first FRE in PLT4. */ + err = sframe_find_fre (dctx, (0x1000 + 16*3 + 0x0), &frep); + TEST("plt-findfre-1: Find first FRE in PLT4", + ((err == 0) && (sframe_fre_get_cfa_offset (dctx, &frep, &err) == 0x1))); + + /* Find the second FRE in PLT4. */ + err = sframe_find_fre (dctx, (0x1000 + 16*3 + 0x6), &frep); + TEST("plt-findfre-1: Find second FRE in PLT4", + ((err == 0) && (sframe_fre_get_cfa_offset (dctx, &frep, &err) == 0x2))); + + /* Find the last FRE in PLT4. */ + err = sframe_find_fre (dctx, (0x1000 + 16*3 + 0xc), &frep); + TEST("plt-findfre-1: Find last FRE in PLT4", + ((err == 0) && (sframe_fre_get_cfa_offset (dctx, &frep, &err) == 0x3))); + + sframe_encoder_free (&ectx); + sframe_decoder_free (&dctx); + + return 0; +} -- 2.39.2