From patchwork Thu Feb 22 16:01:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204844 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp37059dyb; Thu, 22 Feb 2024 08:04:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUrOGJGmUYhvTbWJKbSrgTMgFGf762y5IQhNVsQcJEs+uwvLxxT+4Le23on63PByHp/KqkUSwZT8OD6y+EK6oJC6vpZaQ== X-Google-Smtp-Source: AGHT+IHfqL7gCNcQufpfuK2KO7EUB0OTdsYpTWinxYCkAFm7lvL9OgGtAXktr1Ie68K9jGg8B//H X-Received: by 2002:ac8:5904:0:b0:42c:659d:3950 with SMTP id 4-20020ac85904000000b0042c659d3950mr24278525qty.31.1708617845624; Thu, 22 Feb 2024 08:04:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617845; cv=pass; d=google.com; s=arc-20160816; b=lkNjOf8UBhN8HPfw6emZUJAUhkIFbTtPBkolp1VkHnNbwnpx9p/dG+7AOilP5aOF44 U1u7/7jiXxx4xexwKtc5GBDyVTQ9dejvbuTilAuzpBKM8KVxMx6+jd26nQe02H8TnWbH XsJ74TiTY1LJzn4KCMGhLB+mYydbtbpCjK/Uu+frwCo6X7XDkWR40IJeXWnvcpmp7zYS 4nwWgSBmKDLEyt5uVSi4XCv5+FCJ4qPJv/mk1s1TM2SKys1o+7rMPRI+3Prr5AWCT4kj wljeee5nQXhhlz+b4PUp3QZw1NEoCpcXKYj1k3OmaGGHtVYEmKXusQvvHgZH3fnFf8OM PRzg== 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=o2q9HywUExNqrEjKbid0Z82Vo4n2Y7c4InWCzKhBRaY=; fh=iklzwOpoW46Q8uIjUdllYpVL9ypPiHdrvfOwLf3ltuY=; b=Mf65b2HnGwtjAR7EJrq8Sg1Wn+oLa94ce8uCYKD8rghlTLCHGSVjX5HNm0CHmZ6ZuA qqlPXgvuzen79Nrk+6fyjMaUdYfEJ9Q8tk8YAkkhlzlOWl10BhZAhgzdnP1xwqjgO8bU 6Joi6W4AYndfL3oHu2Gcq4J6Zf7g+8g4BGSpySDw4uW2M/J3iGIgq7N3pYSckQxcO1XT va9Oq83M1lxcSjAUVopRYU4kZuq0QLE7fG6k6F1oGD2pRJTUN/VBIT0N/CRH0uRPKq8H M6YONIgW1CEqh4effu8wS7vYet5P+QEPHsMURmP4exgC7GMejDpWFwMxm5RoKyO/nDtp zt0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=T8nqiuCX; 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 j13-20020ac8404d000000b0042c4534b298si12395323qtl.263.2024.02.22.08.04.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:04:05 -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=T8nqiuCX; 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 CCE20385801A for ; Thu, 22 Feb 2024 16:04:02 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 54D433858416 for ; Thu, 22 Feb 2024 16:01:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54D433858416 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 54D433858416 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617722; cv=none; b=JGYQlpczcXe4NigEdnVICtZfSbG88CxlOtfcetCgiqDfJYEualYDTYk977X2BDLRENGfJ0W4Xu/B/6fpEOGr8VnxV8zxIpV0x9biO8cDN1ChRmUmmFBcG4p6pV+z3sOEmDlbLsA0PuQZ73YUAOX0ntk8lmKRHIFGbXs6HhpL3bk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617722; c=relaxed/simple; bh=dWegxbZMNk3TOUBIgL+XEE0mKlP01k3F7NU/ABRem/Q=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=uLnI4Zv4lupdFn4Hc5tBKlU0MnkMfnjRftekHqm9s7hwtNLEnKTUZRftyO6JkLMHQxWpNIZHJTYEP4QR6Bt3/jXlPTUYk7/Fo8J6E22kAdi51bu+tfQqjNpANfDANFEEFVi6qvKUrfCtZliSEpZ8dYpi6xZrqauo96USgtw422U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MF7apZ016197; Thu, 22 Feb 2024 16:01:36 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=o2q9HywUExNqrEjKbid0Z82Vo4n2Y7c4InWCzKhBRaY=; b=T8nqiuCXTYZ2quhij3MuCSfuwW+B8Phi4WMUMV/6cQp+PwVO8TMg1vaWpGu79NQ42bAL QNVshbDGvAwY5QIa7QaVZn4PbWtU2rT4fXO41nHA3/ac9xZqDACd/nYRyocbTUAsDwUT WIV6CMhNL5itadGZeOvrcMxCQa+AnV9u/lc/vDvnVkwbPQBz8X1QKWoRE9Z/iqQpkrh6 cQAA5jxka1Ew5V8bjYOKmCT9NdiGxTgvAqaZ5qiIZZdFYHyQJ4TJHYv65AzFi3D1Yj2H nab7APv/mLItha3OyrxEC8cT/EG/Gt+TmqO8LuBl+0OQwWGX9aSqTAgDlcat9RdNzYAW Bg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we8mk9nn0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41MF9Q1U024892; Thu, 22 Feb 2024 16:01:33 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we8mk9nkp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41MEr70u009540; Thu, 22 Feb 2024 16:01:31 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wb84pq6k7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:31 +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 41MG1QFn6161136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:28 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DA3320040; 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 C92732006A; Thu, 22 Feb 2024 16:01:25 +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:25 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Indu Bhagat Cc: Jens Remus , Andreas Krebbel , Jan Beulich , Jan Hubicka , Andreas Jaeger , "H.J. Lu" Subject: [PATCH 1/9] x86: Remove unused SFrame CFI RA register variable Date: Thu, 22 Feb 2024 17:01:15 +0100 Message-Id: <20240222160123.2554459-2-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: 2zBk2AZUjjVZXZQ4WnMwYzF_i_eGFETq X-Proofpoint-ORIG-GUID: 1tbKS2b06WVzjMHwSeAVZvhq-4dEv7xS 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 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 priorityscore=1501 clxscore=1011 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402220127 X-Spam-Status: No, score=-12.5 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: 1791615666123928389 X-GMAIL-MSGID: 1791615666123928389 gas/ * config/tc-i386.c: Remove unused SFrame CFI RA register variable. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- gas/config/tc-i386.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index c56ca4a2b4b8..1a6fd52f229a 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -627,7 +627,6 @@ static int shared = 0; unsigned int x86_sframe_cfa_sp_reg; /* The other CFA base register for SFrame stack trace info. */ unsigned int x86_sframe_cfa_fp_reg; -unsigned int x86_sframe_cfa_ra_reg; #endif From patchwork Thu Feb 22 16:01:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204840 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp35269dyb; Thu, 22 Feb 2024 08:02:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU5UFCoDNgcKxuwnweVYB+NPrHBYaW2nT1oNXqgXY8f4D1wEvbFvnu9tUQyJAepq6K/BaAtphHxueia3ZAQwowNRyJHdQ== X-Google-Smtp-Source: AGHT+IEmZasFQH3cAztnTD2kTYZDvZxiOyfcnHUH3q7OpRUeNqhY/NrLFtrtg/yjfM68jCybXEeY X-Received: by 2002:a5d:4578:0:b0:33d:2567:995c with SMTP id a24-20020a5d4578000000b0033d2567995cmr2506596wrc.1.1708617735282; Thu, 22 Feb 2024 08:02:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617735; cv=pass; d=google.com; s=arc-20160816; b=pS0hVKYdHKE1CiJ21Z6wQnSuVtUEMWUwTDHRHlMlV6szoan5qetFRup3lYuFgLYF5b crIcncXt0JWDgwLP+EKQ9e61t4yHatmFs+2x6DFQ0YyQnl5Jh8HEcEXaHa+4dlq8v35C +dQA2jmZ6y53WmSnkGcULBK6eee82YX1ywxLgED/0Cm+HVJubkPb0gpQ1I63aJm6vpmF h2zhEway+WzVsN85JUfHc8p4g6UXDPrvIaycUt9an3ZJYpVdxswVZ3+/pI/+ZKwzU8SN LZc1qgd+N9DCVOCmKsBA+y+d0HJehXPD6860L9Ee0RVjHjPm2bp56g1T4DIsY5+X4eet 1YPg== 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=AzafolOOTGI80OAri5UAi8tYOnbCQqarpYBAnQYFpho=; fh=xzEBZrwKMP5oGYG1oABGV7dpV5/1pQwD40SCh/bfkgM=; b=GW9iGzL7b56DhlXS53qP2WdLsOfbSCW9AnvZVanP1+CIl7lh8HdC/ziU8AcIODw4ZJ crOoXeTPQAyMafZgV9VI9KayPSttJj0lC6EajwvweIab7Ym/RmCz+FxfGEh4QpiqLwFw wVuGi8UBFkIdoOlBccVBvYs41s6wctdobyzYXRvfELgGutqbEYcd/FfuSHVOsh9KVSsQ XeRhHHdcsvi64XdzWo/uOeEdkGfSromcxWNyKEvlPa3VWezA3/HfmcYzJmHXsHiw9tdk nnaj3H6JXjJBIY86hdy065Im/exhPSz7x5vkWS7JZHZ4oiHr6TDOK/pKH89wvGYt7fLa ufCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=TtctC0iL; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e6-20020a5d6d06000000b0033d82dedc72si1864151wrq.340.2024.02.22.08.02.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:02:15 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=TtctC0iL; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 BD02838582BD for ; Thu, 22 Feb 2024 16:02:11 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id C51783858414 for ; Thu, 22 Feb 2024 16:01:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C51783858414 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 C51783858414 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617711; cv=none; b=GEOnpKe9LBYwon/cN16elzU7lJrKZrQfj7xTjVGG/k+JZl9/qZiPNqhuJwOA6Iee1QXV6oH6oQIp9ZxMwKx8/LrGYZqMNATmICvv5HgHCu74R6VEsaPr0CuefFCAlPtnh1LKEmNKt+cNR/8uhj48LOCi7RxhX5m48aj/MtnORXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617711; c=relaxed/simple; bh=cypcZEil3iJ78dzfXmT+I1JFrihonK0qFRIqNJ0Kf4g=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=bfOpPH5YiZTxOv36oHb9dvQ5u6yuYl+cvyBHP1Us7v6Qm8TGXpWVMYyhTasSUs1q9uTvUAzYA5xOkdtFsFRaE2rUA+jkCrwZj4dQFP1G8qnRK4few/JYnpRbBy1hfjF0gOtV6DmcukJmSNT8Cv9ZK2ZgYznY/mBF++GMHP+b0aQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MF7aZe016191; 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=AzafolOOTGI80OAri5UAi8tYOnbCQqarpYBAnQYFpho=; b=TtctC0iLwwRmYM9wOBch5EZ9nZlHXrIlFk/8Q1IBt7g4b191goM92+nsrIXteoh7O4KW 1NAVkNomPI40Vky4F0b2XcRaOLIT/F1lG2tt2fRoMqyy/fxhtd8kZWsHKM10Tad/AU+z ANsQ6NN2wlshN8rOZDjmbUB4TiYCgVIstHiJCBH3O/GXCq8k/LXFo/Cn5fZdjgRuOVA+ eFLMATLf7F9gKcCPyE5Vqqkhiit7+r8fyp3eBIkQyG/6O+cnjvSVabS6x1N4znE60h74 HuCv5u1MV2MDsYyAFp4rXATDlKDgEf7gCVB96bDstD47DqvW+sd0+610Z6wXx/kts/tI hw== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we8mk9nkt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41MDoQGl013532; Thu, 22 Feb 2024 16:01:32 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wb7h0qeyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:31 +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 41MG1QOZ14746202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:28 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DA872004F; 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 1514720043; 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 , Richard Earnshaw , Marcus Shawcroft Subject: [PATCH 2/9] aarch64: Align SFrame terminology in comments to specs and x86 Date: Thu, 22 Feb 2024 17:01:16 +0100 Message-Id: <20240222160123.2554459-3-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: MzKzi60uHcp_oJi6wGyQJ2XZZh1AZYLP X-Proofpoint-ORIG-GUID: MzKzi60uHcp_oJi6wGyQJ2XZZh1AZYLP 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 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 priorityscore=1501 clxscore=1011 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402220127 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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: 1791615550799375300 X-GMAIL-MSGID: 1791615550799375300 Use the term "frame pointer" (FP) instead of "base pointer". This aligns with the terminology used in the SFrame specification. Additionally it helps not to confuse "base-pointer register" with the term "BASE_REG" used in the specification to denote either the SP or FP register. While at it align the frame-pointer and return address register comments to the x86 AMD64 ones. gas/ * config/tc-aarch64.h: Align SFrame terminology in comments to specs and x86 AMD64. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- Notes (jremus): This patch can be dropped, if subsequent patch "sframe: Enhance comments for SFRAME_CFA_*_REG macros" gets accepted. gas/config/tc-aarch64.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h index 1b8badad9fdc..599d78db7908 100644 --- a/gas/config/tc-aarch64.h +++ b/gas/config/tc-aarch64.h @@ -271,11 +271,11 @@ extern bool aarch64_support_sframe_p (void); extern unsigned int aarch64_sframe_cfa_sp_reg; #define SFRAME_CFA_SP_REG aarch64_sframe_cfa_sp_reg -/* The base-pointer register number for CFA stack trace info. */ +/* The frame-pointer register number for SFrame stack trace info. */ extern unsigned int aarch64_sframe_cfa_fp_reg; #define SFRAME_CFA_FP_REG aarch64_sframe_cfa_fp_reg -/* The return address register number for CFA stack trace info. */ +/* The return address register number for SFrame stack trace info. */ extern unsigned int aarch64_sframe_cfa_ra_reg; #define SFRAME_CFA_RA_REG aarch64_sframe_cfa_ra_reg From patchwork Thu Feb 22 16:01:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204843 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp36992dyb; Thu, 22 Feb 2024 08:04:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUzEAt6kU9Yxy5mKAi/9a1H1R2nxbY5rrRhauUY6Hx70QvgDqr8XEkVnmTqc4yQLPJF2gReN2K1Sb2AaQLzfpGci2fREA== X-Google-Smtp-Source: AGHT+IH1iGHq4mSQ5hsYTaFn1XKskxCJ1O22Hbcfhiulpf3kPG2BvGv19FS2IytTZielDBFtYnjo X-Received: by 2002:a05:622a:649:b0:42d:b62e:4f65 with SMTP id a9-20020a05622a064900b0042db62e4f65mr28675404qtb.33.1708617841858; Thu, 22 Feb 2024 08:04:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617841; cv=pass; d=google.com; s=arc-20160816; b=v/TWSVf4ogxMjZG8yxbSpdkbMT9H666m8IXB514R7Hz5CKPMHGMcq1RFlobftd3LNO YXgsxUyLpIx1TPAgcRPbE5L5cXcEGl4zCA/J8ycHtXqEqUntfrwqg05vVB4iY6WpkgJC nNfwUNehd6k4FV2xlOCpNvqypA+69/tBXrs+q/HBD+4Bb3J8r51ZrTvfagGYwnJGpXZJ 3aIoe77Bf0s/7FDF0k5G+QNizS9BgSMfp1SuJhn+dKH8xVC3UHQghqe12euIPuPFtKsz Jn2qDmkwy5Pwfv4/U286JvU+QrH7MmgCpa2xwlpWVphJ6cQM6YSlJ6Rkce6k7SeuYAni 6Sdw== 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=GypbcTQIy25CX5gPMRphgOG4e6hOvVz4ax1zNFV0ogE=; fh=lETL1m2ywGQah3zWJUkKUJG6qExUwxTjGOjnfKMxcDM=; b=uRqnbFDztaPVrb236FIyjneaINmRYsLVVdAYFWVboX9XVgfPSCxA6BjXeHy29hajuZ BnN59o8aSA2szlqSl78GYJ9g13ODqXgL6dDxj5jQhXVmAcWka9prXvwBsXZq8ms8aGPM 593UP8fzNqRc398Y5vtxsg/W6mXtltRmE76FY+V4vCI4MGJ/R99Uhj3UIDEmFteZpmXo EMz5imfYE4wZFJz9urgSL/m8HhqDMrGF3Ny3JeDIQ3YF2GVyE6eN/7a1XKfYPlSdna1G +hpKhVctnIulO2VQv7zvL5hyS1mZG4fPg4Umt/R1g+LSJug/aKQWc5xgFkbHFQxLcV9a KCLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=qX9zJjT9; 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 v35-20020a05622a18a300b0042e4fa976c6si1333630qtc.365.2024.02.22.08.04.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:04:01 -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=qX9zJjT9; 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 76F6E38582A3 for ; Thu, 22 Feb 2024 16:04:00 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 18F09385841B for ; Thu, 22 Feb 2024 16:01:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 18F09385841B 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 18F09385841B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617714; cv=none; b=MwSdBhhf+SDSBUytE2RukIg2MpOWl8WwQFMPwrwbdzKVtnQCIGTwmfxFnGKlAvJwRanWlKTKnU2kHQaBqsG0Dj4tMiUgCpo55bpVPWyuwFUJwEMdztGj5dxcTjETBzwCF+m8EuYk4OIx73rcNRSm1ShKLHlJyGJgTkMd6wDuUjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617714; c=relaxed/simple; bh=viVN2lR23R35KjDRBZKfVgt2VyYqSAZ9Pz6sdCnjb/U=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Oy27h8g3wY/xxK8Tv/O5IJK+r3LIglkXOCFZUrOcr3ieCZ30Lhe2bFAOjcSuBmVKswEys6eHBj5u8A40fUnqLtUV3vQsJVoS9Nf0kqJcRIV0nLGC7TkqrlRUMNBRaADhg0USX55/o+GeF6pkINgGr+S5q6f6/jbacUfU0rHxbYs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MF7bOB016236; Thu, 22 Feb 2024 16:01:37 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=GypbcTQIy25CX5gPMRphgOG4e6hOvVz4ax1zNFV0ogE=; b=qX9zJjT9MsWN8cdnM+oiE3HIO/4HFcq1ivxwluSaGN3vfah3OovOILYZ/3OFl70oFDwp 60QWuUXhNxLqEgvcelGsaaq7TrEniOmXC7cajJ7QN/x4Yb92Wy3CNaXrXEYN49UMwWGk DZsRjyRyixWozZQwdyUF8l9axIyN39DQNeWHyCkh9uHpC+dWQsVnGZfq5dJMmcMZamEW 3hou0ZhEz3WIM5kZ3ThFLXqW7oDkyqlYbpzWKCApj93vbCf0tNPgaqyDOZ71hdyTI9pT yzpDPgjv0kwd8C0Y0CplK4rg14h0ugjOvdGB59/FHVEt6mj5nySWjAwlJrDiCjlb+pqo Qw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we8mk9np8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:35 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41MFPK40022243; Thu, 22 Feb 2024 16:01:34 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we8mk9nm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:34 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41MFMH4m017291; Thu, 22 Feb 2024 16:01:32 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wb8mmq2re-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:32 +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 41MG1Q1r4194886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:28 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AF932006C; 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 450F82006A; 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 , Richard Earnshaw , Marcus Shawcroft , Jan Beulich , Jan Hubicka , Andreas Jaeger , "H.J. Lu" Subject: [PATCH 3/9] sframe: Enhance comments for SFRAME_CFA_*_REG macros Date: Thu, 22 Feb 2024 17:01:17 +0100 Message-Id: <20240222160123.2554459-4-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: _oi7l1whExwoCsb55JqjotlCbCsG_IoY X-Proofpoint-ORIG-GUID: PvaBsjVJIWg_VSAAfcuQHZfCfAdt3Y9A 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 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 phishscore=0 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: 1791615662275999938 X-GMAIL-MSGID: 1791615662275999938 Specify what the SFRAME_CFA_*_REG register numbers are used for: - SP (stack pointer): CFA tracking - FP (frame pointer): CFA and FP tracking - RA (return address): RA tracking gas/ * config/tc-aarch64.h: Enhance comments for SFRAME_CFA_*_REG macros. * config/tc-i386.h: Likewise. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- gas/config/tc-aarch64.h | 6 +++--- gas/config/tc-i386.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h index 599d78db7908..59c9b5a09ec0 100644 --- a/gas/config/tc-aarch64.h +++ b/gas/config/tc-aarch64.h @@ -267,15 +267,15 @@ extern void aarch64_after_parse_args (void); extern bool aarch64_support_sframe_p (void); #define support_sframe_p aarch64_support_sframe_p -/* The stack-pointer register number for SFrame stack trace info. */ +/* The stack-pointer register number for CFA tracking. */ extern unsigned int aarch64_sframe_cfa_sp_reg; #define SFRAME_CFA_SP_REG aarch64_sframe_cfa_sp_reg -/* The frame-pointer register number for SFrame stack trace info. */ +/* The frame-pointer register number for CFA and FP tracking. */ extern unsigned int aarch64_sframe_cfa_fp_reg; #define SFRAME_CFA_FP_REG aarch64_sframe_cfa_fp_reg -/* The return address register number for SFrame stack trace info. */ +/* The return address register number for RA tracking. */ extern unsigned int aarch64_sframe_cfa_ra_reg; #define SFRAME_CFA_RA_REG aarch64_sframe_cfa_ra_reg diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index b93799a3b48c..0d6fb002166f 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -440,11 +440,11 @@ extern bool x86_scfi_callee_saved_p (uint32_t dw2reg_num); extern bool x86_support_sframe_p (void); #define support_sframe_p x86_support_sframe_p -/* The stack-pointer register number for SFrame stack trace info. */ +/* The stack-pointer register number for CFA tracking. */ extern unsigned int x86_sframe_cfa_sp_reg; #define SFRAME_CFA_SP_REG x86_sframe_cfa_sp_reg -/* The frame-pointer register number for SFrame stack trace info. */ +/* The frame-pointer register number for CFA and FP tracking. */ extern unsigned int x86_sframe_cfa_fp_reg; #define SFRAME_CFA_FP_REG x86_sframe_cfa_fp_reg 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); From patchwork Thu Feb 22 16:01:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp36744dyb; Thu, 22 Feb 2024 08:03:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1y9J79APhP4cjvOP7r/9BvNXZWshM4kxeQWk7KuvotVKsWZdhUpDxG6NWRLLN9K/1bDnkennilmbZb6VptIcpyCaCxA== X-Google-Smtp-Source: AGHT+IHuqY1IFyXc/sMy5LYWpe8LYDs7o+LYXM5fhw3+CO7/Nw5uySzZ5F1rfXakd6xYVKBYnGRs X-Received: by 2002:a05:6214:2624:b0:68f:6410:99d7 with SMTP id gv4-20020a056214262400b0068f641099d7mr14656348qvb.64.1708617825910; Thu, 22 Feb 2024 08:03:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617825; cv=pass; d=google.com; s=arc-20160816; b=fyXm5DR9r5T+kvXE2ijJ2974aTUNFj7SJsRF94fUwrrxB/IETNx/JprfPYVotdYZjg /r27HkhDyfZDY4V44/lE7LcpWR3Sb/TrCEkP1WSWFpee3u3GjDbAwLGuYf4VWuVy3lDm 4qIQEU61GE7WEoqkyb88YSdcB40GZeJ25QRjfSOVsrkkA8RnGsKYG8XXubo5eVJCTjJ4 iny/EDJXsQlGboi4BZjaw+zv35hUvv2I+pmWWLgzGMi3vA9+NksZHtwmpu2YT91mZHHR 6NECb35ga48yclyiW9PO3Ijz0DzYfMi2CIx5NtAhpju33nJ7//PQOK2Nd0fuopoIE+WO VdMg== 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=h4cDKDwpj0p1o2IOVxdM1TYODj0Hcqr1m/3zD78wvys=; fh=vTbGg4wY0rLaolKO+EtTu7rlJzNAP3iHbUH+MVoijcQ=; b=VU5+Z4DCGS6fucECmTwbAven4RxudQgCntzl/PnAndfYGmYTRaZFtwyWNYK07N5rXk fq+kh85F23DgKxeYP3jLL4nquHvzx2pYdyX5TPhJ4ZR5FoUFOGLJ5gt8cUpGnq+1vQT0 dnuP8z6I/BVeiAyncC+yM+DU557NwK9VppyFSqwMo9A8lxVQpsDWYZg2N7avxfhUF7sc Sy3P3C6hT9EB/BSWS6DaYWsX7sYRtau4DiGW81ZtXJeTH4nvMDOuDwmHVcAr3cgvR6se 5/BOu4SkvDyEZA3h0FUImyVISEsW34DR0UUhAwVxQkWnMoAyT468UtI0DfSVrBPKtS5t INKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=B93edId1; 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 j2-20020a05621419c200b0068fa742692asi3560875qvc.577.2024.02.22.08.03.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:03:45 -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=B93edId1; 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 6E82E3858D34 for ; Thu, 22 Feb 2024 16:03:45 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 2C953385841C for ; Thu, 22 Feb 2024 16:01:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C953385841C 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 2C953385841C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617719; cv=none; b=gom5TxVR3BCHCwpDD3Sw/5uXKziHCg3e6cfrpgezOXd5mFfSwpXFlcwrAwcnCPOGBAeTYu7wvidR3yxARBqq83BbPOFghK7z9y9i15fx2ruy6KDnnKUt4r3bLjAk3jgs662PZMSssDW/QWzsvrOe9AI+W5g/20TBosiVqNYvEwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617719; c=relaxed/simple; bh=mpgJ/nsuUVudbftEpkk92AQBTn+iF31OBTw1utA3uFg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=gOchfEjtEb/ZVAsI0E8QEkSQZPXsEufjRy5bPAtblwwUis29IscMXETuZKRhTRKuXLAaz5fcVaa6NnvNtlaUsJReZp5dLvQ4tzcTIzCRo8/JIg0rADDtlafUtnyyeJuNJxLXEA3uZYIUoRocjb/omuvphKJcF8+D2k70s7yshAQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MFvD0N032057; 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=h4cDKDwpj0p1o2IOVxdM1TYODj0Hcqr1m/3zD78wvys=; b=B93edId1T1QzLSJE9RyGE5TFK0vJkUAq/gACdiTPL2xE77R0ADkPdDvLDA4FDVb+d1pg hN3mN5kt46XUdjnZHP0V+XPHjcbf7njRMeIxUYWEamLc7AdQQrO603/+oKtqlu6vCHLt 9LJq5wPjx4OK+HvYK09ScvlGYwEuql2vgyK/I7lCWDZnZ2ic/Sd3JOISXFxPETLMxKpS r9fKBeT8yzxoLLxUsbHOFXACdk3RM1Yf6DFWWzLvhnph6Vvg612CjY1PleVLub2dRGnp Oq+x8JYDLvVwAbhuvFj5GzuxXn3uovRUZKKoNqtOaORpQOQepXigB2QDUoEJ15fF7cVe lg== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we9c0082t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:34 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41ME8RV7003624; Thu, 22 Feb 2024 16:01:33 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb74tyg46-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +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 41MG1Sbt59572542 (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 D12772004E; 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 B0FED2006A; 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 5/9] gas: Print DWARF call frame insn name in SFrame warning message Date: Thu, 22 Feb 2024 17:01:19 +0100 Message-Id: <20240222160123.2554459-6-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-ORIG-GUID: YJ8oYeHihZMbrXcckkICgPCMQFTJxLND X-Proofpoint-GUID: YJ8oYeHihZMbrXcckkICgPCMQFTJxLND 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 mlxscore=0 priorityscore=1501 mlxlogscore=999 phishscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 impostorscore=0 suspectscore=0 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: 1791615645516113161 X-GMAIL-MSGID: 1791615645516113161 SFrame generation prints the DWARF call frame instruction opcode in hexadecimal. Leverage get_DW_CFA_name to additionally print the DWARF call frame instruction name in human readable form, while also respecting fake CFI types. Use "(unknown)", if the DWARF call frame instruction name is not known. This changes the following assembler SFrame generation warning message as follows: Old: Warning: skipping SFrame FDE due to DWARF CFI op 0x New: Warning: skipping SFrame FDE due to DWARF CFI op (0x) gas/ * gen-sframe.c (sframe_get_cfi_name): New function to get the DWARF call frame instruction name for a DWARF call frame instruction opcode. (sframe_do_cfi_insn): Use sframe_get_cfi_name to print the DWARF call frame instruction name for the DWARF call frame instruction opcode in the warning message. gas/testsuite/ * gas/cfi-sframe/common-empty-1.d: Update expected SFrame warning message text for DWARF call frame insn name. * gas/cfi-sframe/common-empty-2.d: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-1.l: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-2.l: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-3.l: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-4.l: Likewise. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- gas/gen-sframe.c | 49 ++++++++++++++++++- gas/testsuite/gas/cfi-sframe/common-empty-1.d | 2 +- gas/testsuite/gas/cfi-sframe/common-empty-2.d | 2 +- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 75781fc8ccbd..d35baaac54b2 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -1197,6 +1197,46 @@ sframe_xlate_do_gnu_window_save (struct sframe_xlate_ctx *xlate_ctx, return SFRAME_XLATE_OK; } +/* Returns the DWARF call frame instruction name or fake CFI name for the + specified CFI opcode, or NULL if the value is not recognized. */ + +static const char * +sframe_get_cfi_name (int cfi_opc) +{ + const char *cfi_name; + + switch (cfi_opc) + { + /* Fake CFI type; outside the byte range of any real CFI insn. */ + /* See gas/dw2gencfi.h. */ + case CFI_adjust_cfa_offset: + cfi_name = "CFI_adjust_cfa_offset"; + break; + case CFI_return_column: + cfi_name = "CFI_return_column"; + break; + case CFI_rel_offset: + cfi_name = "CFI_rel_offset"; + break; + case CFI_escape: + cfi_name = "CFI_escape"; + break; + case CFI_signal_frame: + cfi_name = "CFI_signal_frame"; + break; + case CFI_val_encoded_addr: + cfi_name = "CFI_val_encoded_addr"; + break; + case CFI_label: + cfi_name = "CFI_label"; + break; + default: + cfi_name = get_DW_CFA_name (cfi_opc); + } + + return cfi_name; +} + /* Process CFI_INSN and update the translation context with the FRE information. @@ -1272,7 +1312,14 @@ sframe_do_cfi_insn (struct sframe_xlate_ctx *xlate_ctx, /* An error here will cause no SFrame FDE later. Warn the user because this will affect the overall coverage and hence, asynchronicity. */ if (err) - as_warn (_("skipping SFrame FDE due to DWARF CFI op %#x"), op); + { + const char *cfi_name = sframe_get_cfi_name (op); + + if (!cfi_name) + cfi_name = _("(unknown)"); + as_warn (_("skipping SFrame FDE due to DWARF CFI op %s (%#x)"), + cfi_name, op); + } return err; } diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-1.d b/gas/testsuite/gas/cfi-sframe/common-empty-1.d index 125612ff841f..d7756302b559 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-1.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-1.d @@ -1,5 +1,5 @@ #as: --gsframe -#warning: skipping SFrame FDE due to DWARF CFI op 0xa +#warning: skipping SFrame FDE due to DWARF CFI op DW_CFA_remember_state \(0xa\) #objdump: --sframe=.sframe #name: Uninteresting cfi directives generate an empty SFrame section #... diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-2.d b/gas/testsuite/gas/cfi-sframe/common-empty-2.d index 59328fc1033f..20282c7854e8 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-2.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-2.d @@ -1,5 +1,5 @@ #as: --gsframe -#warning: skipping SFrame FDE due to DWARF CFI op 0xe +#warning: skipping SFrame FDE due to DWARF CFI op DW_CFA_def_cfa_offset \(0xe\) #objdump: --sframe=.sframe #name: SFrame supports only FP/SP based CFA #... From patchwork Thu Feb 22 16:01:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204841 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp35793dyb; Thu, 22 Feb 2024 08:02:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXnnoMx98NzCGYUAlD1vXDAhn8Y0z0F0ToHIiQDkgy3vlobUi5VwQ4gQmq+WGqP/dWdhLb8EZiIQ97lxHIAldDpBS/nAA== X-Google-Smtp-Source: AGHT+IGxwTZs/4IzmydMrDkwXnMCk0Ce5h/wrAgEwja13JBepGK+5j1Fa5wa51y+7K1kqygcoB+R X-Received: by 2002:a05:6000:2c2:b0:33d:6fe4:aeaa with SMTP id o2-20020a05600002c200b0033d6fe4aeaamr6699810wry.2.1708617769407; Thu, 22 Feb 2024 08:02:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617769; cv=pass; d=google.com; s=arc-20160816; b=xRCxTxYBf2tAUwLvTtw3xg2Rw8985Id9+7KNUrTb13NNQ1wcJ1oFSYHCWlCGNC2TTQ v+FXpYnul6iOTG5MUtItQ0b9TSGxoHLC/o9GVSXOtqFmKuDjDADU5Q67UPIJHq4+01zz EuxurgRkFvnIBnFZIaCTdW6tTWvgKfS0GJ//HSCT4mqWefTRfEvpES8qI4OhiOFo0qy+ O3Lapu61k+l1+VSgh2yuQaZhXBc9XtDCeqHjOFb9CDJ3rV7cqBiJF1nZY3+lp7NBXwzK NARSfp/AgAZmfvuwsqG5nG4tirIetz0gdlWUldsFJoZWqXeej9RuS/WPkGASRZP12u8G ClaQ== 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=wRnD3F/ysqseFk35pOE9oqFrPxI2Dl5W5BpCn9AlUDQ=; fh=vTbGg4wY0rLaolKO+EtTu7rlJzNAP3iHbUH+MVoijcQ=; b=hHEbEYkVbzXxM0A4J6R6/6kpTgc1sYdLSh8ehyI8WLEtHYzMYMl3OOhSUd5zLtZMHu 4n+T7JR4jegE7jO/4RN/U5XulQe63FAVNQPCHSIj77Yp1zuWTNLrjM4Eq/cjzyxout2G dwZ+sGdQOUNtAfSP0av1iLNE1d+273KMSER0B3U2aNrBImyo5IVcVQE3dYcn+bV57tzt OwcYCiADwmTKyYeuch7YK27L/u4YUe5IIoxvQm46sUosMxOU8Ja/SvgMVhSjr5G7kvHS jxxOS8syt5RWMI2EjC9M27dqDAe+LeOrVTI7Q2CYxF2elbRwkgB2iSS5u7WDlXxc4IFs N6kQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BHjSkLKP; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d15-20020adff84f000000b0033cf7b58f3dsi7914167wrq.849.2024.02.22.08.02.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:02:49 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BHjSkLKP; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 CFCFD3858295 for ; Thu, 22 Feb 2024 16:02:46 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 644973858422 for ; Thu, 22 Feb 2024 16:01:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 644973858422 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 644973858422 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617722; cv=none; b=p0FjkI+Io+nk+KM/S+LMpwuLSPO8XLQPNnZyVAhq8ypm4NFbXfbPI9HMANIs0zwAnuOPEqRAf3h4bjKsdR0Vd8W6Syml52lochHfqi6CsNKzPP3YE8YN1B4RJGnP/vnUx8JGp2hKLdRQ2szLXM4qq3hedmc1R1n5In4pryv/ez8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617722; c=relaxed/simple; bh=JRz4ULfhIu/Mm8u4MWX9wOAttcCOSsulFK48696Ni4U=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ksWg6GJrSbDArenB4FL+FdXLTyNPfgCg+azCo4BTeRBxYYUd5icJ40SgX4FGaoW86lGnjU8SsKFUBzzxQ199pJKIaz619ykRZ/81T8veWOOV6rPxN/Ifqe0XIHzH2Fl3lgVRCLvDcoIU8Icp6PIGw8O1mMIcIBzJGxwXivw3p4U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MFuDGq026822; Thu, 22 Feb 2024 16:01:36 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=wRnD3F/ysqseFk35pOE9oqFrPxI2Dl5W5BpCn9AlUDQ=; b=BHjSkLKPX2iDqbbuZJr1JP34tJeVEiL1nNqoNZquljvKF67m4WuZgZ8xQFI1VRKS0nYp HemX+45ud8pCrJR4X2SJ8hGRwOcfoYTxcUSoOiApTnA5UQbYPYZ0n7PiCdpZedQiqB5O skZK8rmTx81qlDR4LCnc7yLHti4pSSCbj55674p2Ur/YxtmKkdgl4zcGtNPA6yvMcAkb h7gMSK/MtVH1dbrX3JBndXMZSoaNc9h77HHiyTuKZPH0ZniJCsZn6q1rBRp1neSXcLVg p8nw/J3OudzXZIP97R6W1uvI4lm3uyVsoGyRCnpnAp2zX9u6PkDy56QxDfrtvUwKT2+q KQ== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we94x8jtm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41MDpIFp003596; Thu, 22 Feb 2024 16:01:32 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb74tyg44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:32 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41MG1RF234669070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:29 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04C532006A; Thu, 22 Feb 2024 16:01:27 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8B1B20070; 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 6/9] gas: Skip SFrame FDE if CFI specifies non-FP/SP base register Date: Thu, 22 Feb 2024 17:01:20 +0100 Message-Id: <20240222160123.2554459-7-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: KPqHQCryNPj3eXgPrVv3V_jne8Nkh1Vx X-Proofpoint-ORIG-GUID: KPqHQCryNPj3eXgPrVv3V_jne8Nkh1Vx 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 clxscore=1015 adultscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 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: 1791615585732812363 X-GMAIL-MSGID: 1791615585732812363 Do not generate SFrame FDE if DWARF CFI directives .cfi_def_cfa or .cfi_def_cfa_register specify a base register number other than the architecture-specific stack-pointer (SP) or frame-pointer (FP) register numbers. This also causes the assembler to print a warning message, so that skipping of the SFrame FDE does not occur silently. gas/ * gen-sframe.c: Skip SFrame generation if CFI specifies non-FP/SP base register. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- Notes (jremus): Without this patch the assembler would erroneously generate bad SFrame information for the s390-specific SFrame error test cases 1 and 2, that get introduced by patch "s390: Initial support to generate .sframe from CFI directives in assembler". gas/gen-sframe.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index d35baaac54b2..1269b2b77c54 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -986,7 +986,11 @@ sframe_xlate_do_def_cfa (struct sframe_xlate_ctx *xlate_ctx, get_dw_fde_start_addrS (xlate_ctx->dw_fde)); } /* Define the current CFA rule to use the provided register and - offset. */ + offset. However, if the register is not FP/SP, skip creating + SFrame stack trace info for the function. */ + if (cfi_insn->u.r != SFRAME_CFA_SP_REG + && cfi_insn->u.r != SFRAME_CFA_FP_REG) + return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ sframe_fre_set_cfa_base_reg (cur_fre, cfi_insn->u.ri.reg); sframe_fre_set_cfa_offset (cur_fre, cfi_insn->u.ri.offset); cur_fre->merge_candidate = false; @@ -1004,9 +1008,14 @@ sframe_xlate_do_def_cfa_register (struct sframe_xlate_ctx *xlate_ctx, struct sframe_row_entry *last_fre = xlate_ctx->last_fre; /* Get the scratchpad FRE. This FRE will eventually get linked in. */ struct sframe_row_entry *cur_fre = xlate_ctx->cur_fre; + gas_assert (cur_fre); /* Define the current CFA rule to use the provided register (but to - keep the old offset). */ + keep the old offset). However, if the register is not FP/SP, + skip creating SFrame stack trace info for the function. */ + if (cfi_insn->u.r != SFRAME_CFA_SP_REG + && cfi_insn->u.r != SFRAME_CFA_FP_REG) + return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ sframe_fre_set_cfa_base_reg (cur_fre, cfi_insn->u.ri.reg); sframe_fre_set_cfa_offset (cur_fre, last_fre->cfa_offset); cur_fre->merge_candidate = false; From patchwork Thu Feb 22 16:01:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp38552dyb; Thu, 22 Feb 2024 08:05:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXa+j1qi2Jq0JRxCj61cUzrcpAbVNwzQKXsCBV1BqY33ov7bD6op7AnY9ApW/qNt8RY4vzFqlNujSNF6XnEOvsc6g02SA== X-Google-Smtp-Source: AGHT+IF6DPy+ZM1j8vrScJ14K9suG/0QuUOXCkQVzBeDP1zZsEzSpnaWkUI9Bd7YSOrJnTn0Jt4V X-Received: by 2002:a05:620a:12fc:b0:787:a7d6:7f17 with SMTP id f28-20020a05620a12fc00b00787a7d67f17mr916655qkl.20.1708617939776; Thu, 22 Feb 2024 08:05:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617939; cv=pass; d=google.com; s=arc-20160816; b=yLO6VVxJIUs6WlLQDC/bVhn2eRzGK6rhbGplWFqaBitLQGG2oCxzmDIJ8KkvScxhFf bWJFezPB3xWuKLUWHJG5UXmh4wzleGq3A57pa/gPk1aiYMRqWF9k0+quGQDoxiF9GHlG 84CUZAMw8eWvtZArdumK6KdDWnMnwFH78nLD4ROCVMvTFsYnVNO0tCPB9PL+sHAUZrLe oiBKKh4C46WqQDogROUtO6XwkqendP+LOKukA+2/MC/+yGIsnU1UI2P2G+C3j4OCzJJd wArbRX1fVTgYSgxTVg1WfSWEymb4KfxecIVT0ZicKIKcd/4iB696JbnfGh0xoKvzZQ6P XyBw== 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=xc0ac9H02FAYFCeJ/bKpc3sW7Bi4+/xiIRQP/uN96/Y=; fh=vTbGg4wY0rLaolKO+EtTu7rlJzNAP3iHbUH+MVoijcQ=; b=iSBlR4lI8zjDViQx/kv3FRXlEh3bok0IbANyykxEy+ON+k9UAUr+GAZ1fLqeeFeBxz fVeJCocwWItMST/BnDQ9/oiJWzYeu9MKyAvtuEdergGcaokBo9ZYJEyRkiZdliaNPnlY h+XjnN3VhSNqJbMPgbLTxNGkjWb2t+HAwisBUHVh5vl6dEzF5DFrkM1pY8tQYx7+9Vl+ 8KuslJ6vXRqLGPRvqGL2zXhupsx9eAjAZn0Par2YHUG4G5YU1gkjqvdZCl2uUU03nO0T 3+LWjvC5c7iE2iC3Fapyz1MXnL2d2j2P8rgAL1vhtZk8FKovlftXw5FX72VOSDDb34m+ kvow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=HMBS69cw; 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 a21-20020a05620a02f500b007878d8964bfsi1442571qko.316.2024.02.22.08.05.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:05:39 -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=HMBS69cw; 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 704D0385841A for ; Thu, 22 Feb 2024 16:05:39 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 5B9DA3858420 for ; Thu, 22 Feb 2024 16:01:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B9DA3858420 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 5B9DA3858420 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617724; cv=none; b=p1PbM3Wwb0jUc7GynZEs6oyKvgfH3aXsOLvsqvitj7nDpWK/CSXvJZrsMepBJBr4z+DEhGIpINrTG65cbgSMOPyMhfl/YP/05JNJHKmMprqWU0zzM8QybUBK3KtRekIaJEGIvH7vA+ZoGFw8GY9xotdebT/KXEkb1qkMWhzs3Sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617724; c=relaxed/simple; bh=8wXT1CTqqwfOVlzLDmsKJiYjkWRNBXZlnhJUrQQWVFg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=JkcWJYJ7+myGTwPWq8IL/9p5mWaAwS49NsB+Cye4YlJZi07Vzyy+Tdt76xd7NitzY6jxZMwgeeF37zPW7OEXp/wTA4mitIG+HAk522gu1+QYVMEulIgURIkTEg6CJXHMeaCPlwZ3feUR3oSUtbyGQtaKNfbU671OwUFiT5DomDQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MG1Cdp022064; Thu, 22 Feb 2024 16:01:46 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=xc0ac9H02FAYFCeJ/bKpc3sW7Bi4+/xiIRQP/uN96/Y=; b=HMBS69cw/G7WTz/N5InpA93/R91aF30bGorvqm6HasXRge1Q2idRG94t00JG7iXGXz6o nFclGtYJlEBMKq1B3DhosYJCjfKVPSZ1vYAFjiVVBP46F4Nzm0PI5nlVGdAepFalP5bf gsczuwTzUaqbsVgu3VBTL/OA0pZNmWaTruLmH1Qmet9L9wZee338tK3Y9/0BtNhJsLHt 2iGH3iXVshvgbsbEJsM5QwyDbntATK9FT7At5e0mZoQx3wdNRm+7XtfhrumzakPV2C8F UXE6VFz4x6/cHUVrAia/wq5HdzLYVZwB/r2msSFh8y+yg7hh8OMJbRgJdBEsRXzjEPKE eg== 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 3we8b424n8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +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 41MFVd0E031138; Thu, 22 Feb 2024 16:01:32 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb9bm6ske-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:32 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41MG1Rb726345798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:29 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C1A120070; Thu, 22 Feb 2024 16:01:27 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C38F2006B; Thu, 22 Feb 2024 16:01:27 +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 7/9] gas: Warn if SFrame FDE is skipped due to non-default return column Date: Thu, 22 Feb 2024 17:01:21 +0100 Message-Id: <20240222160123.2554459-8-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: IjuSEPi5mQwZ_qe72TfkQL5RIDyfDqHm X-Proofpoint-ORIG-GUID: IjuSEPi5mQwZ_qe72TfkQL5RIDyfDqHm 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 mlxscore=0 adultscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402220127 X-Spam-Status: No, score=-12.5 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: 1791615764573508028 X-GMAIL-MSGID: 1791615764573508028 Print a warning message if SFrame FDE is skipped due to a non-default DWARF return column (i.e. return address (RA) register number). This may be caused by the use of CFI directive .cfi_return_column with a non-default return address (RA) register number in the processed assembler source code. Warning: skipping SFrame FDE due to non-default DWARF return column gas/ * gen-sframe.c: Warn if SFrame FDE is skipped due to non-default DWARF return column. gas/testsuite/ * gas/cfi-sframe/common-empty-3.d: Update test case to expect for new warning message when SFrame FDE is skipped due to a non-default DWARF return column. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- Notes (jremus): Without this patch the assembler would erroneously generate bad SFrame information for the s390-specific SFrame error test case 4, that gets introduced by patch "s390: Initial support to generate .sframe from CFI directives in assembler". gas/gen-sframe.c | 8 ++++++-- gas/testsuite/gas/cfi-sframe/common-empty-3.d | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 1269b2b77c54..28b49a2a8425 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -1345,7 +1345,10 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx, /* If the return column is not RIP, SFrame format cannot represent it. */ if (xlate_ctx->dw_fde->return_column != DWARF2_DEFAULT_RETURN_COLUMN) - return SFRAME_XLATE_ERR_NOTREPRESENTED; + { + as_warn (_("skipping SFrame FDE due to non-default DWARF return column")); + return SFRAME_XLATE_ERR_NOTREPRESENTED; + } /* Iterate over the CFIs and create SFrame FREs. */ for (cfi_insn = dw_fde->data; cfi_insn; cfi_insn = cfi_insn->next) @@ -1355,7 +1358,8 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx, if (err != SFRAME_XLATE_OK) { /* Skip generating SFrame stack trace info for the function if any - offending CFI is encountered by sframe_do_cfi_insn (). */ + offending CFI is encountered by sframe_do_cfi_insn (). Warning + message already printed by sframe_do_cfi_insn (). */ return err; /* Return the error code. */ } } diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-3.d b/gas/testsuite/gas/cfi-sframe/common-empty-3.d index 5914c620760d..d17521dd88ea 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-3.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-3.d @@ -1,4 +1,5 @@ #as: --gsframe +#warning: skipping SFrame FDE due to non-default DWARF return column #objdump: --sframe=.sframe #name: SFrame supports only default return column #... From patchwork Thu Feb 22 16:01:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp37448dyb; Thu, 22 Feb 2024 08:04:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW6CZN3HSu8dbaZnrUpelA9ePNmswHbwqRO+tlNDsl02L7tP1qjFVTH88cxr5HU+fx3eAXDCNPzD3nb+zPM/rdGTUg17w== X-Google-Smtp-Source: AGHT+IGJQGnLHLz3erHrIQstXxlJA3z/Sie1d0pmMKHQK0vOhg/JyZ+gWKkgQLYwCVNXsTcOmY/9 X-Received: by 2002:a0d:ea0b:0:b0:608:a1a9:9fb5 with SMTP id t11-20020a0dea0b000000b00608a1a99fb5mr854700ywe.5.1708617870078; Thu, 22 Feb 2024 08:04:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617870; cv=pass; d=google.com; s=arc-20160816; b=0Lknr6Uhw/1O5qwJAiMraiFSIw2uuy81WwGfjVyZ1v+jkm49zVo6ow8NCb4CRTU+Og Smt4kicVM10KmoVHsALTRd6FSYqvt1HFsacfhs6L4didDitrMSWVJDSUu4v5CfEhXnGV YO7Cm3RIdhSp/sRjqZ0w5ydQN6VQhhorpiAbxj7tIStftZzm2iytKlyIVi7WxpHrPenU 3UyYp1zgZ/VLVZ9/IcYolkhPODul9lt8Lt6FVs+gPH5CdVL/Kinppp8u1uuIHwpqwniB AYbfmZSRsFQXkOwnTw3LSMY7iD+Mvjm0AwOVJSZYmTpfs8KgzQca8UQFWEHZJTMmJOL4 oTYg== 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=pjLkNurtuZqK3UmzRB4cPL+fRNrhdZbHUtXdPgVxhbE=; fh=vTbGg4wY0rLaolKO+EtTu7rlJzNAP3iHbUH+MVoijcQ=; b=a9IyifEJV1uoCKovLiHqRadM6Q9rJqAiBr2b+PVQz9vmCVX1uz54BJ8M9d/4jDmG/+ r2EOSc5T9w/SSBS5aSzAnNrbh20hR523c3yWHDjxHtPX4wI9mI637xLOokjnvCHAUiUp 0hdbmbWQ3NtkZk9rgzhBioCZOMqwNQHHS3s5jN8fJbUsHl4LdK6xvkioTU29NBFjH1yM wN+ZTmIkDS/nxGJ3cHoHsNh+xvCDG866HAkhGxABYnEwu9fgiWpnZ6yXBOqDczdhtvFD irHuPQs3gYcKBawEyvt1gaXbvoteXED0HxSf2zb6yezeaiAqfSgDhMXwQIsSR4yLXzXZ nS4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Ab68rxif; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u26-20020a81b61a000000b0060483a2d9e2si5901149ywh.329.2024.02.22.08.04.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:04:30 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Ab68rxif; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 A4F8338582A9 for ; Thu, 22 Feb 2024 16:04:26 +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 3A1D53858D33 for ; Thu, 22 Feb 2024 16:01:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A1D53858D33 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 3A1D53858D33 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=1708617722; cv=none; b=IQ2JJwvYXKtM9FWEz0cgwplvpyU+qoDjVE8VkqbD4BtcFGXzJuj5NWTnWPmBkaKAp4MkcpIq9cM+EbupkZyHvF3aX6l1YCrKUA1qn52bGO8mCUhpOm/P2jmgUbuprpR6FPU2R1QF1BBO7FWAxrMK9hHPTGSG0uAdnJdWpwmca5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617722; c=relaxed/simple; bh=sw5Q0zk7GL31r+s4mEWOZTYgquU4J1c58tZJrJB6sy4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=xJgY7GYKArjESBXcs39j4opWsYKNmaAslHvlCBBQA++IVQCPeqffqhnk8k0k24QlL9FtVd+4rlC8cmrd28XrQ2X61P9UZ1kkclLSwBxkwDv1ncOlsua8tW9jxGdBkHJbB96drSWA7SiAfCxuhuv8sKyXIZx0EtEfxCrgvkhtDcI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MFnLY2030333; Thu, 22 Feb 2024 16:01:34 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=pjLkNurtuZqK3UmzRB4cPL+fRNrhdZbHUtXdPgVxhbE=; b=Ab68rxifP70JFpM1VsgV8C+E9odBSNCB38cFUtksBCtLW98OHbXUOXK1LtQaHvbbhz26 yIuJROLhp7pqFIEu0slfmwusfg7HxwDaEXCNddTEn7jIAtTdX/9qNvtT8idlikeyon/0 hWU1MK9XrsB0kLmM+WPkxeVcpBgDleLFdJJE7SCTAx9UIWptsIo84rK8Q6wq9UbzXwwI 0fPBEuJePmVj6NScMroLtQoRWYKYJL7tRHN1MnAEdrWLt0pWMb+5HXIbXsa3rPbIhDWB BKghAO8+/Mhn7fxQecU1fVVnqvtOqTz7jIPmxcRh/cRkQkDJtzxfTZxnfQ4QXVMqToSK rA== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we878jdxs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41MDBeOw014343; Thu, 22 Feb 2024 16:01:32 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb9u2xnyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:32 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41MG1Rh430147116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:29 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A3E02004B; Thu, 22 Feb 2024 16:01:27 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 33C2120071; Thu, 22 Feb 2024 16:01:27 +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:27 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Indu Bhagat Cc: Jens Remus , Andreas Krebbel Subject: [PATCH 8/9] gas: User readable warnings if SFrame FDE is not generated Date: Thu, 22 Feb 2024 17:01:22 +0100 Message-Id: <20240222160123.2554459-9-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: -7_4VJAN6d3r3BRGfe0QVRH0Cn6jHmtZ X-Proofpoint-ORIG-GUID: -7_4VJAN6d3r3BRGfe0QVRH0Cn6jHmtZ 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 clxscore=1011 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402220127 X-Spam-Status: No, score=-12.5 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: 1791615691821739237 X-GMAIL-MSGID: 1791615691821739237 The following generic warning message, which is printed whenever the assembler skips generation of SFrame FDE, is not very helpful for the user: skipping SFrame FDE due to DWARF CFI op (0x) Whenever possible print meaningful warning messages, when the assembler skips generation of SFrame FDE: - skipping SFrame FDE due to .cfi_def_cfa specifying CFA base register other than SP or FP ( instead of or ) - skipping SFrame FDE due to .cfi_def_cfa_register specifying CFA base register other than SP or FP ( instead of or ) - skipping SFrame FDE due to .cfi_def_cfa_offset without CFA base register in effect - skipping SFrame FDE due to .cfi_def_cfa_offset while CFA base register other than SP or FP in effect ( instead of or ) - skipping SFrame FDE due to .cfi_val_offset specifying {FP|RA} register () - skipping SFrame FDE due to .cfi_remember_state without SFrame FRE state - skipping SFrame FDE due to .cfi_register specifying {SP|FP|RA} register () - skipping SFrame FDE due to non-default DWARF return column ( instead of ) gas/ * gen-sframe.h (SFRAME_FRE_BASE_REG_INVAL): New macro for invalid SFrame FRE CFA base register value of -1. * gen-sframe.c: User readable warnings if SFrame FDE is not generated. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- gas/gen-sframe.c | 96 ++++++++++++++----- gas/gen-sframe.h | 2 + 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 +- 5 files changed, 79 insertions(+), 25 deletions(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 28b49a2a8425..339f4412ca05 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -867,7 +867,7 @@ sframe_row_entry_new (void) struct sframe_row_entry *fre = XCNEW (struct sframe_row_entry); /* Reset cfa_base_reg to -1. A value of 0 will imply some valid register for the supported arches. */ - fre->cfa_base_reg = -1; + fre->cfa_base_reg = SFRAME_FRE_BASE_REG_INVAL; fre->merge_candidate = true; /* Reset the mangled RA status bit to zero by default. We will initialize it in sframe_row_entry_initialize () with the sticky bit if set. */ @@ -922,6 +922,24 @@ sframe_row_entry_initialize (struct sframe_row_entry *cur_fre, cur_fre->mangled_ra_p = prev_fre->mangled_ra_p; } +/* Return SFrame register name for SP, FP, and RA, or NULL if other. */ + +static const char * +sframe_register_name (unsigned int reg) +{ + if (reg == SFRAME_CFA_SP_REG) + return "SP"; + else if (reg == SFRAME_CFA_FP_REG) + return "FP"; +#ifdef SFRAME_FRE_RA_TRACKING + else if (sframe_ra_tracking_p () + && (reg == SFRAME_CFA_RA_REG)) + return "RA"; +#endif + else + return NULL; +} + /* Translate DW_CFA_advance_loc into SFrame context. Return SFRAME_XLATE_OK if success. */ @@ -990,7 +1008,12 @@ sframe_xlate_do_def_cfa (struct sframe_xlate_ctx *xlate_ctx, SFrame stack trace info for the function. */ if (cfi_insn->u.r != SFRAME_CFA_SP_REG && cfi_insn->u.r != SFRAME_CFA_FP_REG) - return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + { + as_warn (_("skipping SFrame FDE due to .cfi_def_cfa specifying CFA base " + "register other than SP or FP (%u instead of %u or %u)"), + cfi_insn->u.r, SFRAME_CFA_SP_REG, SFRAME_CFA_FP_REG); + return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + } sframe_fre_set_cfa_base_reg (cur_fre, cfi_insn->u.ri.reg); sframe_fre_set_cfa_offset (cur_fre, cfi_insn->u.ri.offset); cur_fre->merge_candidate = false; @@ -1015,7 +1038,12 @@ sframe_xlate_do_def_cfa_register (struct sframe_xlate_ctx *xlate_ctx, skip creating SFrame stack trace info for the function. */ if (cfi_insn->u.r != SFRAME_CFA_SP_REG && cfi_insn->u.r != SFRAME_CFA_FP_REG) - return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + { + as_warn (_("skipping SFrame FDE due to .cfi_def_cfa_register specifying " + "CFA base register other than SP or FP (%u instead of %u or %u)"), + cfi_insn->u.r, SFRAME_CFA_SP_REG, SFRAME_CFA_FP_REG); + return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + } sframe_fre_set_cfa_base_reg (cur_fre, cfi_insn->u.ri.reg); sframe_fre_set_cfa_offset (cur_fre, last_fre->cfa_offset); cur_fre->merge_candidate = false; @@ -1046,7 +1074,16 @@ sframe_xlate_do_def_cfa_offset (struct sframe_xlate_ctx *xlate_ctx, cur_fre->merge_candidate = false; } else - return SFRAME_XLATE_ERR_NOTREPRESENTED; + { + if (cur_fre->cfa_base_reg == SFRAME_FRE_BASE_REG_INVAL) + as_warn (_("skipping SFrame FDE due to .cfi_def_cfa_offset without CFA " + "base register in effect")); + else + as_warn (_("skipping SFrame FDE due to .cfi_def_cfa_offset while CFA " + "base register other than SP or FP in effect (%u instead of %u or %u)"), + cur_fre->cfa_base_reg, SFRAME_CFA_SP_REG, SFRAME_CFA_FP_REG); + return SFRAME_XLATE_ERR_NOTREPRESENTED; + } return SFRAME_XLATE_OK; } @@ -1097,11 +1134,19 @@ sframe_xlate_do_val_offset (struct sframe_xlate_ctx *xlate_ctx ATTRIBUTE_UNUSED, instruction can be safely skipped without sacrificing the asynchronicity of stack trace information. */ if (cfi_insn->u.r == SFRAME_CFA_FP_REG) - return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + { + as_warn (_("skipping SFrame FDE due to .cfi_val_offset specifying FP register (%u)"), + SFRAME_CFA_FP_REG); + return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + } #ifdef SFRAME_FRE_RA_TRACKING else if (sframe_ra_tracking_p () && cfi_insn->u.r == SFRAME_CFA_RA_REG) - return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + { + as_warn (_("skipping SFrame FDE due to .cfi_val_offset specifying RA register (%u)"), + SFRAME_CFA_RA_REG); + return SFRAME_XLATE_ERR_NOTREPRESENTED; /* Not represented. */ + } #endif /* Safe to skip. */ @@ -1120,7 +1165,10 @@ sframe_xlate_do_remember_state (struct sframe_xlate_ctx *xlate_ctx) early with non-zero error code, this will cause no SFrame stack trace info for the function involved. */ if (!last_fre) - return SFRAME_XLATE_ERR_INVAL; + { + as_warn (_("skipping SFrame FDE due to .cfi_remember_state without SFrame FRE state")); + return SFRAME_XLATE_ERR_INVAL; + } if (!xlate_ctx->remember_fre) xlate_ctx->remember_fre = sframe_row_entry_new (); @@ -1307,7 +1355,12 @@ sframe_do_cfi_insn (struct sframe_xlate_ctx *xlate_ctx, || cfi_insn->u.rr.reg1 == SFRAME_CFA_RA_REG #endif || cfi_insn->u.rr.reg1 == SFRAME_CFA_FP_REG) - err = SFRAME_XLATE_ERR_NOTREPRESENTED; + { + as_warn (_("skipping SFrame FDE due to .cfi_register specifying %s register (%u)"), + sframe_register_name (cfi_insn->u.rr.reg1), + cfi_insn->u.rr.reg1); + err = SFRAME_XLATE_ERR_NOTREPRESENTED; + } break; case DW_CFA_undefined: case DW_CFA_same_value: @@ -1315,21 +1368,19 @@ sframe_do_cfi_insn (struct sframe_xlate_ctx *xlate_ctx, default: /* Following skipped operations do, however, impact the asynchronicity: - CFI_escape. */ - err = SFRAME_XLATE_ERR_NOTREPRESENTED; - } - - /* An error here will cause no SFrame FDE later. Warn the user because this - will affect the overall coverage and hence, asynchronicity. */ - if (err) - { - const char *cfi_name = sframe_get_cfi_name (op); - - if (!cfi_name) - cfi_name = _("(unknown)"); - as_warn (_("skipping SFrame FDE due to DWARF CFI op %s (%#x)"), - cfi_name, op); + { + const char *cfi_name = sframe_get_cfi_name (op); + + if (!cfi_name) + cfi_name = _("(unknown)"); + as_warn (_("skipping SFrame FDE due to DWARF CFI op %s (%#x)"), + cfi_name, op); + err = SFRAME_XLATE_ERR_NOTREPRESENTED; + } } + /* Any error will cause no SFrame FDE later. The user has already been + warned. */ return err; } @@ -1346,7 +1397,8 @@ sframe_do_fde (struct sframe_xlate_ctx *xlate_ctx, /* If the return column is not RIP, SFrame format cannot represent it. */ if (xlate_ctx->dw_fde->return_column != DWARF2_DEFAULT_RETURN_COLUMN) { - as_warn (_("skipping SFrame FDE due to non-default DWARF return column")); + as_warn (_("skipping SFrame FDE due to non-default DWARF return column (%u instead of %u)"), + xlate_ctx->dw_fde->return_column, DWARF2_DEFAULT_RETURN_COLUMN); return SFRAME_XLATE_ERR_NOTREPRESENTED; } diff --git a/gas/gen-sframe.h b/gas/gen-sframe.h index fbe2fd5d9368..8ed46dbb087b 100644 --- a/gas/gen-sframe.h +++ b/gas/gen-sframe.h @@ -24,6 +24,8 @@ #define SFRAME_FRE_ELEM_LOC_REG 0 #define SFRAME_FRE_ELEM_LOC_STACK 1 +#define SFRAME_FRE_BASE_REG_INVAL ((unsigned int)-1) + /* SFrame Frame Row Entry (FRE). A frame row entry is a slice of the frame and can be valid for a set of diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-1.d b/gas/testsuite/gas/cfi-sframe/common-empty-1.d index d7756302b559..08731b069229 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-1.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-1.d @@ -1,5 +1,5 @@ #as: --gsframe -#warning: skipping SFrame FDE due to DWARF CFI op DW_CFA_remember_state \(0xa\) +#warning: skipping SFrame FDE due to \.cfi_remember_state without SFrame FRE state #objdump: --sframe=.sframe #name: Uninteresting cfi directives generate an empty SFrame section #... diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-2.d b/gas/testsuite/gas/cfi-sframe/common-empty-2.d index 20282c7854e8..e759cddfcc20 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-2.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-2.d @@ -1,5 +1,5 @@ #as: --gsframe -#warning: skipping SFrame FDE due to DWARF CFI op DW_CFA_def_cfa_offset \(0xe\) +#warning: skipping SFrame FDE due to \.cfi_def_cfa_offset without CFA base register in effect #objdump: --sframe=.sframe #name: SFrame supports only FP/SP based CFA #... diff --git a/gas/testsuite/gas/cfi-sframe/common-empty-3.d b/gas/testsuite/gas/cfi-sframe/common-empty-3.d index d17521dd88ea..9a46b016a9ba 100644 --- a/gas/testsuite/gas/cfi-sframe/common-empty-3.d +++ b/gas/testsuite/gas/cfi-sframe/common-empty-3.d @@ -1,5 +1,5 @@ #as: --gsframe -#warning: skipping SFrame FDE due to non-default DWARF return column +#warning: skipping SFrame FDE due to non-default DWARF return column \(0 instead of \d+\) #objdump: --sframe=.sframe #name: SFrame supports only default return column #... From patchwork Thu Feb 22 16:01:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 204846 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp38184dyb; Thu, 22 Feb 2024 08:05:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXE2G6POIchEEp2+dBe1FHD2A1CCXxcICNFytN1+LgzPeTfxHHrzKUZCt/2YoUa7f4WmbpiFIlrONw4qbvtzdxG6YGhFA== X-Google-Smtp-Source: AGHT+IGDg/bKZbOagqaSTlwB9pguf6vLzTsnBXiGDTqVwOs6Rb18xcUBPkNfjKmMvBziE7NETM+6 X-Received: by 2002:a0c:df05:0:b0:68f:2cab:843 with SMTP id g5-20020a0cdf05000000b0068f2cab0843mr19737702qvl.32.1708617916212; Thu, 22 Feb 2024 08:05:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617916; cv=pass; d=google.com; s=arc-20160816; b=zSEXvEaOwY3m7pKGCC37WZS48WDlcwuccDHV5AAAi/D5PTak/BsZpESlg6XAckRujy p0r5rhLNT+OBiMiTzbk+ULpuWlEeR0ScI5gU///o4VFKkICQO7IgMi0qWWBkIZ3KsgVN SMXCm3UP1o6q8XMwIONf4cxVMUXCy8icAEGIGEsDnoXG8WAaxPEhK7eSkNoZ9mI+tfhz yyH/R55mTJSPHBPlghr+sFQ7RGzq2PCD9AeYtAwN0zkcJdQB/nyhxvBq/uRQ6j0x0R03 dP1cib5l+TMUd1P+KeeT8QPhrTgOwyuoVzbGTIHa5A0lhbagWFXQ6HPYSyn6asRJGkc6 Ck1A== 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:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=3177u7vYZkOj6itgz6YrRkpwCcrBf8Q3Ywv1TWTnbjY=; fh=vTbGg4wY0rLaolKO+EtTu7rlJzNAP3iHbUH+MVoijcQ=; b=nycZbmU0fxaOORJNof79tkNOUmgTDc8YFWOZZ0NAT6Mg3ADV831tTcAdHGBWRADkw9 gNvbudIOmnkcaHbGQxGxDW9vPcWm8OGbOsdVlO9FWRTRvVc6+Ip77zxnLmOK/6VZi1UF /L17AOHxSi8xYUzxFNJ2fT6HYGreMzoNFvNua1lMtCD8c7DodEQ9K+by9R/r1GsmlMKj 9IQmWtCXm7C2FN0Lfg7SN51Ii7aDVRUIAZzbP5+j2yU5p6C2CUUU6KhtL0O7kVBxhP7R ehshTAqQbxUMJng5VaACwP15xL+3D63r9gozE1gHan7fD90TTwOhQIAHRmXr14OcwMvS 29Bg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=hCBLO7Nx; 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 hf2-20020a0562140e8200b0068f144bdd81si2997795qvb.358.2024.02.22.08.05.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 08:05:16 -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=hCBLO7Nx; 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 DBEDA3858430 for ; Thu, 22 Feb 2024 16:05:15 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id A3A543858418 for ; Thu, 22 Feb 2024 16:01:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A3A543858418 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 A3A543858418 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617725; cv=none; b=QINeWSET9VLLqhoAIHsxbEkYpyn++9ByB0wCmsMoujw7Qa1sDusk6kD6U5LFs8lqvTSSYe8AO83y/BVWLTY300ByUbaebDwT5pGpfjqpgVPy3tckWbjPziq7Q7CImcU7s8pGazRQoHWglQOVtZT4/smrz21ujmoOS093gMiZ36g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708617725; c=relaxed/simple; bh=VLyyx7GXsrBlk1SfnMjS/MfLB7l+muVpqC3V1EDNm/A=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=jp8aQb/8FyOaynu5MMtiObn/MU+TcVUoRcJ11gnaYinYWEUfso7QuPwIkh+RNRikSnq7JhNkuWeczozXS3pUIUY4qsLOH4eVNrwF+S8vpbQEnFqv9tE/twIENvn0Cncacbr/Ek+wpZSS3rPx6TMwngugoyN2guh1KyNPbhcPwgs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41MF7bAx016235; Thu, 22 Feb 2024 16:01:37 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 : content-transfer-encoding : mime-version; s=pp1; bh=3177u7vYZkOj6itgz6YrRkpwCcrBf8Q3Ywv1TWTnbjY=; b=hCBLO7Nx85nlT60OPFpYsNzP0guX4iWWrUiYINL5LhUI2KKebLcJhjmZsEd2C/Ks/e8a 0W1gnCsoq5fUGiVo0/c8U/cwpFHu7y3kF1rXOzn2RggeKxflmuzSu59W9eSZ98Hr/msG AWzNUmk3suvikvOU8kS0ZCJudKO1Lkv1/EO9WaA8f9TD94EdcFxVnnOvCAjHvF1ruuKv 5NRz0Py9KB7y11G+3gTYJWoxuUWi+qsepvy8l4H1b4DSTLT7MZFVVeEZcjJMPn6q385I 1bwnyvSdQoJ2X8PRUVBBzsdpZmWcX3KLOmctOCtE0WLZguC5u3vl6wOw9SICvV1mBfJI eQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3we8mk9nnd-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 (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41MDVeOc013452; Thu, 22 Feb 2024 16:01:33 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wb7h0qeyr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 16:01:33 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41MG1R9d42664546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Feb 2024 16:01:29 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9269D20071; Thu, 22 Feb 2024 16:01:27 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61E5E2006B; Thu, 22 Feb 2024 16:01:27 +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:27 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Indu Bhagat Cc: Jens Remus , Andreas Krebbel Subject: [RFC PATCH 9/9] s390: Initial support to generate .sframe from CFI directives in assembler Date: Thu, 22 Feb 2024 17:01:23 +0100 Message-Id: <20240222160123.2554459-10-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> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: JiF3DGh_wDre6-ScIgztCCWdyuJYMXXV X-Proofpoint-ORIG-GUID: JiF3DGh_wDre6-ScIgztCCWdyuJYMXXV X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402220127 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, KAM_STOCKGEN, 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: 1791615739951797324 X-GMAIL-MSGID: 1791615739951797324 This introduces initial support to generate .sframe from CFI directives in assembler on s390x. Due to the following SFrame limitations it is incomplete and does not work for most real-world applications (i.e. generation of SFrame FDE is skipped): - SFrame FP/RA tracking assumes the register contents to be saved on the stack (i.e. .cfi_offset). It does not support FP/RA register contents being saved in other registers (i.e. .cfi_register). GCC on s390x can be observed to save the FP/RA register contents in other registers (e.g. floating-point registers). - SFrame assumes a static RA register number. While the s390x ELF ABI [1] specifies register 14 to contain the return address on entry, GCC can be observed to copy the return address to another register and may even use that to return. Additionally glibc on s390x has two functions (mcount and fentry) that specify register 0 to hold the return address. This would either require a change to glibc (if possible) or SFrame support to track the RA register number specified in CFI directive .cfi_return_column. - SFrame assumes a static FP register number. The s390x ELF ABI [1] does not specify any FP register number. GCC and clang on s390x usually use register 11 as frame pointer. GCC on s390x can also be observed to use register 14 (e.g. binutils and glibc builds). glibc on s390x contains code that uses register 12 for the frame pointer. This would require SFrame support to track the SP/FP register number specified in CFI directives .cfi_def_cfa and .cfi_def_cfa_register. - SFrame does not support CFI directive .cfi_val_offset. glibc on s390x has two functions (mcount and fentry), that make use of that CFI directive. This would either require a change in glibc (if possible) or SFrame to support CFI directive .cfi_val_offset. This s390x support is largely based on the AArch64 support from commit b52c4ee46657 ("gas: generate .sframe from CFI directives"). SFrame ABI/arch identifier SFRAME_ABI_S390_ENDIAN_BIG is introduced for s390 and added to the SFrame specification. According to the s390x ELF ABI [1] the following calling conventions are used on s390x architecture: - Register 15 is used as stack pointer (SP). The CFA is initially located at offset +160 from the SP. - Register 14 is used as return address (RA). - There is no dedicated frame pointer. GCC and LLVM currently use register 11 as frame pointer. The s390x ELF ABI [1] standard stack frame layout has the following conventions: - The return address (RA, r15) may be saved at offset -40 from the CFA. Unlike x86 AMD64 architecture it is not necessarily saved on the stack. Also compilers may use a non-standard stack frame layout, such as but not limited to GCC with option -mpacked-stack. Therefore SFrame RA tracking is used. - The potential frame pointer (FP, r11) may be saved at offset -72 from the CFA. It is not necessarily saved on the stack and compilers may use a non-standard stack frame layout (see above). Therefore SFrame FP tracking is used. Support for SFrame is only enabled for z/Architecture (s390x) with 64-bit architecture mode. It is disabled for 32-bit architecture mode and ESA/390 (s390). Add s390-specific SFrame test cases. As for the error test cases add ones that use a non-default frame pointer (FP) register number and ones that save the return address (RA) in a non-default RA register number. [1] ELF ABI s390x Supplement: https://github.com/IBM/s390x-abi/releases [2] ELF ABI s390 Supplement: https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_s390.html https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_s390.pdf include/ * sframe.h (SFRAME_ABI_S390_ENDIAN_BIG): Define SFrame ABI/arch identifier for s390x. Reference s390x architecture in comments. libsframe/ * doc/sframe-spec.texi: Document SFrame ABI/arch identifier for s390x and reference s390x architecture. gas/ * config/tc-s390.h: s390x support to generate .sframe from CFI directives in assembler. * config/tc-s390.c: Likewise. * gen-sframe.c: Reference s390x architecture in comments. gas/testsuite/ * gas/cfi-sframe/cfi-sframe.exp: Enable common SFrame test cases for s390x. Add s390-specific SFrame test cases. * gas/cfi-sframe/cfi-sframe-s390-1.s: New s390-specific SFrame test case. * gas/cfi-sframe/cfi-sframe-s390-1.d: Likewise. * gas/cfi-sframe/cfi-sframe-s390-2.s: Likewise. * gas/cfi-sframe/cfi-sframe-s390-2.d: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-1.s: New s390-specific SFrame error test case that uses a non-default register number for the frame pointer. * gas/cfi-sframe/cfi-sframe-s390-err-1.l: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-2.s: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-2.l: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-3.s: New s390-specific SFrame error test case that uses a non-default register number to save the return address. * gas/cfi-sframe/cfi-sframe-s390-err-3.l: Likewise. * gas/cfi-sframe/cfi-sframe-s390-err-4.s: New s390-specific SFrame error test case that used a non-default return column (return address) register number. * gas/cfi-sframe/cfi-sframe-s390-err-4.l: Likewise. Reviewed-by: Andreas Krebbel Signed-off-by: Jens Remus --- Notes (jremus): The SFrame support for s390x provided by this patch still has some open issues, which need to be addressed. Any ideas or assistance to overcome the SFrame limitations listed in the commit description are very welcome. Note that unlike the AArch64 and x68 AMD64 implementation this s390x implementation does statically initialize the architecture-dependent variables s390_sframe_cfa_{sp|fp|ra}_reg, which are referenced by the SFrame interface macros SFRAME_CFA_{SP|FP|RA}_REG. The other implementations do initialize them in md_begin. I verified that all occurrences of the macros SFRAME_CFA_{SP|FP|RA}_REG are in context of test/read and never write. Is there a reason to define the SFrame interface macros SFRAME_CFA_{SP|FP|RA}_REG to variables? For instance should the SFrame common code be able to modify these? Currently I do not see how it would work well, if the architecture-specific code would change these at run time. Similar for the predicate sframe_ra_tracking_p. Example #1: Warnings when compiling binutils with SFrame $ ../configure CC="gcc -B$HOME/temp/binutils-gcc/bin -Wa,--gsframe" \ CXX="g++ -B$HOME/temp/binutils-gcc/bin -Wa,--gsframe" \ --prefix=$HOME/temp/binutils-sframe $ make -j $(nprocs) 2>&1 | tee make.log $ grep --only-matching "Warning:.*" make.log | sort | uniq -c 1 Warning: skipping SFrame FDE due to .cfi_def_cfa specifying CFA base register other than SP or FP (14 instead of 15 or 11) 205 Warning: skipping SFrame FDE due to .cfi_register specifying FP register (11) 56 Warning: skipping SFrame FDE due to .cfi_register specifying SP register (15) Example #2: Warnings when compiling glibc with SFrame $ ../configure CC="gcc -B$HOME/temp/binutils-sframe/bin -Wa,--gsframe" \ CXX="g++ -B$HOME/temp/binutils-sframe/bin -Wa,--gsframe" \ --prefix=$HOME/temp/glibc-sframe $ make -j $(nprocs) 2>&1 | tee make.log $ grep --only-matching "Warning:.*" make.log | sort | uniq -c 2 Warning: skipping SFrame FDE due to .cfi_def_cfa_register specifying CFA base register other than SP or FP (12 instead of 15 or 11) 7 Warning: skipping SFrame FDE due to .cfi_def_cfa specifying CFA base register other than SP or FP (14 instead of 15 or 11) 225 Warning: skipping SFrame FDE due to .cfi_register specifying FP register (11) 187 Warning: skipping SFrame FDE due to .cfi_register specifying SP register (15) 2 Warning: skipping SFrame FDE due to DWARF CFI op CFI_escape (0x103) 2 Warning: skipping SFrame FDE due to non-default DWARF return column (0 instead of 14) .cfi_def_cfa 14, ... originates from GCC generated code, which uses register %r14 as frame pointer (FP). .cfi_def_cfa_register 12 originates from hand-written assembler code sysdeps/s390/s390-64/dl-trampoline.S, which uses register %r12 as frame pointer (FP). .cfi_return_column 0 and .cfi_escape both originate from hand-written assembler code sysdeps/s390/s390-64/s390x-mcount.S, which is compiled twice (with and without -DSHARED). - .cfi_escape 0x14, 0x15, 0x14: Is used to code ".cfi_val_offset r15, -160", which would require binutils 2.28+ (glibc currently supports a minimum binutils 2.25). This CFI directive states that the contents of register %r15 are CFA-160 (not to be confused with saved at CFA-160). - .cfi_return_column 0: The following comment explains why register %r0 contains the return address: "The _mcount implementation now has to call __mcount_internal with the address of .LP0 as first parameter and the return address as second parameter. &.LP0 was loaded to %r1 and the return address is in %r14. _mcount may not modify any register. Alternatively, at the start of each function __fentry__ is called using a single brasl 0,__fentry__ instruction. In this case %r0 points to the callee, and %r14 points to the caller. These values need to be passed to __mcount_internal using the same sequence as for _mcount, so the code below is shared between both functions. The only major difference is that __fentry__ cannot return through %r0, in which the return address is located, because br instruction is a no-op with this register. Therefore %r1, which is clobbered by the PLT anyway, is used." Excerpt of the relevant glibc source code: .globl C_SYMBOL_NAME(MCOUNT_SYMBOL) .type C_SYMBOL_NAME(MCOUNT_SYMBOL), @function cfi_startproc .align ALIGNARG(4) C_LABEL(MCOUNT_SYMBOL) cfi_return_column (glue(r, MCOUNT_CALLEE_REG)) /* Save the caller-clobbered registers. */ aghi %r15,-224 cfi_adjust_cfa_offset (224) /* binutils 2.28+: .cfi_val_offset r15, -160 */ .cfi_escape \ /* DW_CFA_val_offset */ 0x14, \ /* r15 */ 0x0f, \ /* scaled offset */ 0x14 stmg %r14,%r5,160(%r15) cfi_offset (r14, -224) cfi_offset (r0, -224+16) ... gas/config/tc-s390.c | 55 +++++++++++++++++++ gas/config/tc-s390.h | 31 +++++++++++ gas/gen-sframe.c | 2 +- .../gas/cfi-sframe/cfi-sframe-s390-1.d | 23 ++++++++ .../gas/cfi-sframe/cfi-sframe-s390-1.s | 37 +++++++++++++ .../gas/cfi-sframe/cfi-sframe-s390-2.d | 23 ++++++++ .../gas/cfi-sframe/cfi-sframe-s390-2.s | 37 +++++++++++++ .../gas/cfi-sframe/cfi-sframe-s390-err-1.d | 15 +++++ .../gas/cfi-sframe/cfi-sframe-s390-err-1.s | 37 +++++++++++++ .../gas/cfi-sframe/cfi-sframe-s390-err-2.d | 15 +++++ .../gas/cfi-sframe/cfi-sframe-s390-err-2.s | 37 +++++++++++++ .../gas/cfi-sframe/cfi-sframe-s390-err-3.d | 15 +++++ .../gas/cfi-sframe/cfi-sframe-s390-err-3.s | 6 ++ .../gas/cfi-sframe/cfi-sframe-s390-err-4.d | 15 +++++ .../gas/cfi-sframe/cfi-sframe-s390-err-4.s | 5 ++ gas/testsuite/gas/cfi-sframe/cfi-sframe.exp | 13 ++++- include/sframe.h | 7 ++- libsframe/doc/sframe-spec.texi | 8 ++- 18 files changed, 374 insertions(+), 7 deletions(-) create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.d create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.s create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.d create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.s create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.d create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.s create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.d create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.s create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.d create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.s create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.d create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.s diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 09a903aea2db..af0d705b63f7 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -24,6 +24,8 @@ #include "subsegs.h" #include "dwarf2dbg.h" #include "dw2gencfi.h" +#include "sframe.h" +#include "gen-sframe.h" #include "opcode/s390.h" #include "elf/s390.h" @@ -83,6 +85,17 @@ const char FLT_CHARS[] = "dD"; /* The dwarf2 data alignment, adjusted for 32 or 64 bit. */ int s390_cie_data_alignment; +/* Register numbers used for SFrame stack trace info. */ + +/* Stack-pointer DWARF register number according to s390x ELF ABI. */ +unsigned int s390_sframe_cfa_sp_reg = 15; + +/* Frame-pointer DWARF register number accoring to s390x GCC/LLVM convention. */ +unsigned int s390_sframe_cfa_fp_reg = 11; + +/* Return-address DWARF register number according to s390x ELF ABI. */ +unsigned int s390_sframe_cfa_ra_reg = DWARF2_DEFAULT_RETURN_COLUMN; + /* The target specific pseudo-ops which we support. */ /* Define the prototypes for the pseudo-ops */ @@ -2639,6 +2652,48 @@ tc_s390_regname_to_dw2regnum (char *regname) return regnum; } +/* Whether SFrame stack trace info is supported. */ + +bool +s390_support_sframe_p (void) +{ + /* At this time, SFrame is supported for s390x (64-bit) only. */ + return (s390_arch_size == 64); +} + +/* Specify if RA tracking is needed. */ + +bool +s390_sframe_ra_tracking_p (void) +{ + return true; +} + +/* Specify the fixed offset to recover RA from CFA. + (useful only when RA tracking is not needed). */ + +offsetT +s390_sframe_cfa_ra_offset (void) +{ + return (offsetT) SFRAME_CFA_FIXED_RA_INVALID; +} + +/* Get the abi/arch indentifier for SFrame. */ + +unsigned char +s390_sframe_get_abi_arch (void) +{ + unsigned char sframe_abi_arch = 0; + + if (s390_support_sframe_p ()) + { + gas_assert (target_big_endian); + sframe_abi_arch = SFRAME_ABI_S390_ENDIAN_BIG; + } + + return sframe_abi_arch; +} + void s390_elf_final_processing (void) { diff --git a/gas/config/tc-s390.h b/gas/config/tc-s390.h index cd353045a822..c8f172d8737b 100644 --- a/gas/config/tc-s390.h +++ b/gas/config/tc-s390.h @@ -98,3 +98,34 @@ extern int s390_cie_data_alignment; extern void s390_elf_final_processing (void); #define elf_tc_final_processing s390_elf_final_processing + +/* SFrame */ + +/* Whether SFrame stack trace info is supported. */ +extern bool s390_support_sframe_p (void); +#define support_sframe_p s390_support_sframe_p + +/* The stack-pointer register number for SFrame stack trace info. */ +extern unsigned int s390_sframe_cfa_sp_reg; +#define SFRAME_CFA_SP_REG s390_sframe_cfa_sp_reg + +/* The frame-pointer register number for SFrame stack trace info. */ +extern unsigned int s390_sframe_cfa_fp_reg; +#define SFRAME_CFA_FP_REG s390_sframe_cfa_fp_reg + +/* The return address register number for SFrame stack trace info. */ +extern unsigned int s390_sframe_cfa_ra_reg; +#define SFRAME_CFA_RA_REG s390_sframe_cfa_ra_reg + +/* Specify if RA tracking is needed. */ +extern bool s390_sframe_ra_tracking_p (void); +#define sframe_ra_tracking_p s390_sframe_ra_tracking_p + +/* Specify the fixed offset to recover RA from CFA. + (useful only when RA tracking is not needed). */ +extern offsetT s390_sframe_cfa_ra_offset (void); +#define sframe_cfa_ra_offset s390_sframe_cfa_ra_offset + +/* The abi/arch indentifier for SFrame. */ +unsigned char s390_sframe_get_abi_arch (void); +#define sframe_get_abi_arch s390_sframe_get_abi_arch diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 339f4412ca05..08849cdafa81 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -673,7 +673,7 @@ output_sframe_internal (void) #endif out_one (fixed_ra_offset); - /* None of the AMD64, or AARCH64 ABIs need the auxiliary header. + /* None of the AMD64, AARCH64, or S390 ABIs need the auxiliary header. When the need does arise to use this field, the appropriate backend must provide this information. */ out_one (0); /* Auxiliary SFrame header length. */ diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.d new file mode 100644 index 000000000000..211804a2309a --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.d @@ -0,0 +1,23 @@ +#objdump: --sframe=.sframe +#name: SFrame generation on s390 +#... +Contents of the SFrame section .sframe: + + Header : + + Version: SFRAME_VERSION_2 + Flags: NONE + Num FDEs: 1 + Num FREs: 6 + + Function Index : + + func idx \[0\]: pc = 0x0, size = 40 bytes + STARTPC +CFA +FP +RA + + 0+0000 +sp\+160 +u +u + + 0+0006 +sp\+160 +c\-72 +c\-48 + + 0+000c +sp\+336 +c\-72 +c\-48 + + 0+0010 +fp\+336 +c\-72 +c\-48 + + 0+001c +sp\+160 +u +u + + 0+001e +fp\+336 +c\-72 +c\-48 + +#pass diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.s new file mode 100644 index 000000000000..56d8425ae2b1 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-1.s @@ -0,0 +1,37 @@ + .cfi_sections .sframe + .cfi_startproc + stmg %r6,%r15,48(%r15) + .cfi_offset 6, -112 + .cfi_offset 7, -104 + .cfi_offset 8, -96 + .cfi_offset 9, -88 + .cfi_offset 10, -80 + .cfi_offset 11, -72 + .cfi_offset 12, -64 + .cfi_offset 13, -56 + .cfi_offset 14, -48 + .cfi_offset 15, -40 + lay %r15,-176(%r15) + .cfi_def_cfa_offset 336 + lgr %r11,%r15 + .cfi_def_cfa_register 11 + lay %r15,-128(%r15) +.Lreturn: + lmg %r6,%r15,224(%r11) + .cfi_remember_state + .cfi_restore 15 + .cfi_restore 14 + .cfi_restore 13 + .cfi_restore 12 + .cfi_restore 11 + .cfi_restore 10 + .cfi_restore 9 + .cfi_restore 8 + .cfi_restore 7 + .cfi_restore 6 + .cfi_def_cfa 15, 160 + br %r14 + .cfi_restore_state + lay %r15,-128(%r15) + j .Lreturn + .cfi_endproc diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.d new file mode 100644 index 000000000000..211804a2309a --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.d @@ -0,0 +1,23 @@ +#objdump: --sframe=.sframe +#name: SFrame generation on s390 +#... +Contents of the SFrame section .sframe: + + Header : + + Version: SFRAME_VERSION_2 + Flags: NONE + Num FDEs: 1 + Num FREs: 6 + + Function Index : + + func idx \[0\]: pc = 0x0, size = 40 bytes + STARTPC +CFA +FP +RA + + 0+0000 +sp\+160 +u +u + + 0+0006 +sp\+160 +c\-72 +c\-48 + + 0+000c +sp\+336 +c\-72 +c\-48 + + 0+0010 +fp\+336 +c\-72 +c\-48 + + 0+001c +sp\+160 +u +u + + 0+001e +fp\+336 +c\-72 +c\-48 + +#pass diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.s new file mode 100644 index 000000000000..4d58cdaf64a7 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-2.s @@ -0,0 +1,37 @@ + .cfi_sections .sframe + .cfi_startproc + stmg %r6,%r15,48(%r15) + .cfi_rel_offset 6, 48 + .cfi_rel_offset 7, 56 + .cfi_rel_offset 8, 64 + .cfi_rel_offset 9, 72 + .cfi_rel_offset 10, 80 + .cfi_rel_offset 11, 88 + .cfi_rel_offset 12, 96 + .cfi_rel_offset 13, 104 + .cfi_rel_offset 14, 112 + .cfi_rel_offset 15, 120 + lay %r15,-176(%r15) + .cfi_def_cfa_offset 336 + lgr %r11,%r15 + .cfi_def_cfa_register 11 + lay %r15,-128(%r15) +.Lreturn: + lmg %r6,%r15,224(%r11) + .cfi_remember_state + .cfi_restore 15 + .cfi_restore 14 + .cfi_restore 13 + .cfi_restore 12 + .cfi_restore 11 + .cfi_restore 10 + .cfi_restore 9 + .cfi_restore 8 + .cfi_restore 7 + .cfi_restore 6 + .cfi_def_cfa 15, 160 + br %r14 + .cfi_restore_state + lay %r15,-128(%r15) + j .Lreturn + .cfi_endproc diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.d new file mode 100644 index 000000000000..a2724802c04b --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.d @@ -0,0 +1,15 @@ +#name: SFrame generation on s390 +#as: --gsframe +#warning: skipping SFrame FDE due to .cfi_def_cfa_register specifying CFA base register other than SP or FP \(10 instead of 15 or 11\) +#objdump: --sframe=.sframe +#... +Contents of the SFrame section .sframe: + + Header : + + Version: SFRAME_VERSION_2 + Flags: NONE + Num FDEs: 0 + Num FREs: 0 + +#pass diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.s new file mode 100644 index 000000000000..85e36c39d2a3 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-1.s @@ -0,0 +1,37 @@ + .cfi_sections .sframe + .cfi_startproc + stmg %r6,%r15,48(%r15) + .cfi_offset 6, -112 + .cfi_offset 7, -104 + .cfi_offset 8, -96 + .cfi_offset 9, -88 + .cfi_offset 10, -80 + .cfi_offset 11, -72 + .cfi_offset 12, -64 + .cfi_offset 13, -56 + .cfi_offset 14, -48 + .cfi_offset 15, -40 + lay %r15,-176(%r15) + .cfi_def_cfa_offset 336 + lgr %r10,%r15 + .cfi_def_cfa_register 10 # non-default frame pointer register + lay %r15,-128(%r15) +.Lreturn: + lmg %r6,%r15,224(%r10) + .cfi_remember_state + .cfi_restore 15 + .cfi_restore 14 + .cfi_restore 13 + .cfi_restore 12 + .cfi_restore 11 + .cfi_restore 10 + .cfi_restore 9 + .cfi_restore 8 + .cfi_restore 7 + .cfi_restore 6 + .cfi_def_cfa 15, 160 + br %r14 + .cfi_restore_state + lay %r15,-128(%r15) + j .Lreturn + .cfi_endproc diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.d new file mode 100644 index 000000000000..914f01ad9ffe --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.d @@ -0,0 +1,15 @@ +#name: SFrame generation on s390 +#as: --gsframe +#warning: skipping SFrame FDE due to .cfi_def_cfa specifying CFA base register other than SP or FP \(10 instead of 15 or 11\) +#objdump: --sframe=.sframe +#... +Contents of the SFrame section .sframe: + + Header : + + Version: SFRAME_VERSION_2 + Flags: NONE + Num FDEs: 0 + Num FREs: 0 + +#pass diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.s new file mode 100644 index 000000000000..0bb274a9e991 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-2.s @@ -0,0 +1,37 @@ + .cfi_sections .sframe + .cfi_startproc + stmg %r6,%r15,48(%r15) + .cfi_offset 6, -112 + .cfi_offset 7, -104 + .cfi_offset 8, -96 + .cfi_offset 9, -88 + .cfi_offset 10, -80 + .cfi_offset 11, -72 + .cfi_offset 12, -64 + .cfi_offset 13, -56 + .cfi_offset 14, -48 + .cfi_offset 15, -40 + lay %r15,-176(%r15) + .cfi_def_cfa_offset 336 + lgr %r10,%r15 + .cfi_def_cfa 10, 336 # non-default frame pointer register + lay %r15,-128(%r15) +.Lreturn: + lmg %r6,%r15,224(%r10) + .cfi_remember_state + .cfi_restore 15 + .cfi_restore 14 + .cfi_restore 13 + .cfi_restore 12 + .cfi_restore 11 + .cfi_restore 10 + .cfi_restore 9 + .cfi_restore 8 + .cfi_restore 7 + .cfi_restore 6 + .cfi_def_cfa 15, 160 + br %r14 + .cfi_restore_state + lay %r15,-128(%r15) + j .Lreturn + .cfi_endproc diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.d new file mode 100644 index 000000000000..54a7252f81a3 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.d @@ -0,0 +1,15 @@ +#name: SFrame generation on s390 +#as: --gsframe +#warning: skipping SFrame FDE due to .cfi_register specifying RA register \(14\) +#objdump: --sframe=.sframe +#... +Contents of the SFrame section .sframe: + + Header : + + Version: SFRAME_VERSION_2 + Flags: NONE + Num FDEs: 0 + Num FREs: 0 + +#pass diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.s new file mode 100644 index 000000000000..f0a5bd577304 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.s @@ -0,0 +1,6 @@ + .cfi_sections .sframe + .cfi_startproc + lgr %r7,%r14 + .cfi_register 14, 7 # non-default return address register + br %r7 + .cfi_endproc diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.d new file mode 100644 index 000000000000..71769e7cf077 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.d @@ -0,0 +1,15 @@ +#name: SFrame generation on s390 +#as: --gsframe +#warning: skipping SFrame FDE due to non-default DWARF return column \(7 instead of 14\) +#objdump: --sframe=.sframe +#... +Contents of the SFrame section .sframe: + + Header : + + Version: SFRAME_VERSION_2 + Flags: NONE + Num FDEs: 0 + Num FREs: 0 + +#pass diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.s new file mode 100644 index 000000000000..cfdea75e0b95 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-4.s @@ -0,0 +1,5 @@ + .cfi_sections .sframe + .cfi_startproc + .cfi_return_column 7 # non-default return address register + br %r7 + .cfi_endproc diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp index cfae28d39aaf..9411c0e6c9ce 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp @@ -64,7 +64,8 @@ proc gas_x86_64_check { } { } # common tests -if { ([istarget "x86_64-*-*"] || [istarget "aarch64*-*-*"]) \ +if { ([istarget "x86_64-*-*"] || [istarget "aarch64*-*-*"] || + [istarget "s390x-*-*"]) \ && [gas_sframe_check] } then { global ASFLAGS @@ -99,3 +100,13 @@ if { [istarget "aarch64*-*-*"] && [gas_sframe_check] } then { run_dump_test "cfi-sframe-aarch64-2" run_dump_test "cfi-sframe-aarch64-pac-ab-key-1" } + +# s390 specific tests +if { [istarget "s390x*-*-*"] && [gas_sframe_check] } then { + run_dump_test "cfi-sframe-s390-1" + run_dump_test "cfi-sframe-s390-2" + run_dump_test "cfi-sframe-s390-err-1" + run_dump_test "cfi-sframe-s390-err-2" + run_dump_test "cfi-sframe-s390-err-3" + run_dump_test "cfi-sframe-s390-err-4" +} diff --git a/include/sframe.h b/include/sframe.h index b3d0c2e937d3..90bc92a32f84 100644 --- a/include/sframe.h +++ b/include/sframe.h @@ -93,6 +93,7 @@ extern "C" #define SFRAME_ABI_AARCH64_ENDIAN_BIG 1 /* AARCH64 big endian. */ #define SFRAME_ABI_AARCH64_ENDIAN_LITTLE 2 /* AARCH64 little endian. */ #define SFRAME_ABI_AMD64_ENDIAN_LITTLE 3 /* AMD64 little endian. */ +#define SFRAME_ABI_S390_ENDIAN_BIG 4 /* S390 big endian. */ /* SFrame FRE types. */ #define SFRAME_FRE_TYPE_ADDR1 0 @@ -190,7 +191,7 @@ typedef struct sframe_func_desc_entry - 2-bits: Unused. ------------------------------------------------------------------------ | Unused | PAC auth A/B key (aarch64) | FDE type | FRE type | - | | Unused (amd64) | | | + | | Unused (amd64, s390) | | | ------------------------------------------------------------------------ 8 6 5 4 0 */ uint8_t sfde_func_info; @@ -248,7 +249,7 @@ typedef struct sframe_fre_info - 1 bit: Mangled RA state bit (aarch64 only). ---------------------------------------------------------------------------------- | Mangled-RA (aarch64) | Size of offsets | Number of offsets | base_reg | - | Unused (amd64) | | | | + | Unused (amd64, s390) | | | | ---------------------------------------------------------------------------------- 8 7 5 1 0 @@ -274,7 +275,7 @@ typedef struct sframe_fre_info /* SFrame Frame Row Entry definitions. - Used for both AMD64 and AARCH64. + Used for AMD64, AARCH64, and S390. An SFrame Frame Row Entry is a self-sufficient record which contains information on how to generate the stack trace for the specified range of diff --git a/libsframe/doc/sframe-spec.texi b/libsframe/doc/sframe-spec.texi index d0f99bd698eb..a81faf49f5c1 100644 --- a/libsframe/doc/sframe-spec.texi +++ b/libsframe/doc/sframe-spec.texi @@ -74,8 +74,8 @@ The SFrame stack trace information is provided in a loaded section, known as the @code{.sframe} section. When available, the @code{.sframe} section appears in a new segment of its own, PT_GNU_SFRAME. -The SFrame format is currently supported only for select ABIs, namely, AMD64 -and AAPCS64. +The SFrame format is currently supported only for select ABIs, namely, AMD64, +AAPCS64, and s390. A portion of the SFrame format follows an unaligned on-disk representation. Some data structures, however, (namely the SFrame header and the SFrame @@ -366,6 +366,10 @@ in the format. @item @code{SFRAME_ABI_AMD64_ENDIAN_LITTLE} @tab 3 @tab AMD64 little-endian +@tindex SFRAME_ABI_S390_ENDIAN_BIG +@item @code{SFRAME_ABI_S390_ENDIAN_BIG} +@tab 4 @tab s390 big-endian + @end multitable The presence of an explicit identification of ABI/arch in SFrame may allow