From patchwork Mon Feb 6 22:25:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64377 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1F713858002 for ; Mon, 6 Feb 2023 22:25:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1F713858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722351; bh=KadMHGm+DvV/l4I7MJjOiz4VTIqab21aZLMeAQPSN+c=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=GF2UVBF3Z774lFk4OgUnS51Dxi1VfNBV8mVInjX2TzSKirs4ou0teE0ABBEZR6BRz pdA7jRaLQFguClCemSGKc0d+dOe0j5lKiWVse2JjUJWJJI2i725Pi6JFu1E4z8OB6C R7c+2mv8iqQSnrk0BZp1W7VtqqhUbGVPGa2qDW9M= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 398023858D35 for ; Mon, 6 Feb 2023 22:25:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 398023858D35 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316LVfkH037679 for ; Mon, 6 Feb 2023 22:25:28 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9hvs4wn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:27 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316HBxH0024259 for ; Mon, 6 Feb 2023 22:25:25 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06tvf1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:25 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPKw449348902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:20 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B942120075; Mon, 6 Feb 2023 22:25:20 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74A8420074; Mon, 6 Feb 2023 22:25:20 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:20 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 01/11] libdwfl: Fix debuginfod_client redefinition Date: Mon, 6 Feb 2023 23:25:03 +0100 Message-Id: <20230206222513.1773039-2-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 6KrbULTuDyE3QcTTEfUklZUGfqcao4RE X-Proofpoint-GUID: 6KrbULTuDyE3QcTTEfUklZUGfqcao4RE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=625 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" clang complains: In file included from debuginfod-client.c:38: ./../debuginfod/debuginfod.h:47:34: error: redefinition of typedef 'debuginfod_client' is a C11 feature [-Werror,-Wtypedef-redefinition] typedef struct debuginfod_client debuginfod_client; ^ ./libdwfl.h:53:34: note: previous definition is here typedef struct debuginfod_client debuginfod_client; ^ config/eu.am specifies -std=gnu99, and upgrading just for this is an overkill. So is #including "debuginfod.h", since we don't know if users even have it. So fix by using "struct debuginfod_client" instead. This may break the clients that use dwfl_get_debuginfod_client() without #including "debuginfod.h", but such cases should be rare. Signed-off-by: Ilya Leoshkevich --- libdwfl/debuginfod-client.c | 2 +- libdwfl/libdwfl.h | 5 +---- libdwfl/libdwflP.h | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/libdwfl/debuginfod-client.c b/libdwfl/debuginfod-client.c index 882a5eff..c6f8e083 100644 --- a/libdwfl/debuginfod-client.c +++ b/libdwfl/debuginfod-client.c @@ -143,7 +143,7 @@ __libdwfl_debuginfod_init (void) #else // ENABLE_LIBDEBUGINFOD -debuginfod_client * +struct debuginfod_client * dwfl_get_debuginfod_client (Dwfl *dummy __attribute__ ((unused))) { return NULL; diff --git a/libdwfl/libdwfl.h b/libdwfl/libdwfl.h index 9114f7f0..ba2f081f 100644 --- a/libdwfl/libdwfl.h +++ b/libdwfl/libdwfl.h @@ -49,9 +49,6 @@ typedef struct Dwfl_Thread Dwfl_Thread; PC location described by an FDE belonging to Dwfl_Thread. */ typedef struct Dwfl_Frame Dwfl_Frame; -/* Handle for debuginfod-client connection. */ -typedef struct debuginfod_client debuginfod_client; - /* Callbacks. */ typedef struct { @@ -813,7 +810,7 @@ int dwfl_frame_reg (Dwfl_Frame *state, unsigned regno, Dwarf_Word *val) first call to this function. If elfutils is compiled without support for debuginfod, NULL will be returned. */ -extern debuginfod_client *dwfl_get_debuginfod_client (Dwfl *dwfl); +extern struct debuginfod_client *dwfl_get_debuginfod_client (Dwfl *dwfl); #ifdef __cplusplus } diff --git a/libdwfl/libdwflP.h b/libdwfl/libdwflP.h index cdc528d0..fbd66f45 100644 --- a/libdwfl/libdwflP.h +++ b/libdwfl/libdwflP.h @@ -114,7 +114,7 @@ struct Dwfl { const Dwfl_Callbacks *callbacks; #ifdef ENABLE_LIBDEBUGINFOD - debuginfod_client *debuginfod; + struct debuginfod_client *debuginfod; #endif Dwfl_Module *modulelist; /* List in order used by full traversals. */ @@ -652,7 +652,7 @@ __libdwfl_debuginfod_find_debuginfo (Dwfl *dwfl, const unsigned char *build_id_bits, size_t build_id_len); void -__libdwfl_debuginfod_end (debuginfod_client *c); +__libdwfl_debuginfod_end (struct debuginfod_client *c); #endif From patchwork Mon Feb 6 22:25:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64373 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1510D3858033 for ; Mon, 6 Feb 2023 22:25:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1510D3858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722340; bh=XghC+ICze9Rh/Ps4n2U1LiLuh5D0wEU8AlykMLXyKa8=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=neVu+FLSgWKSp4/xCb182jpOlChp0p3su9dwYXspVqN1nSAkuxxI1a6xDcuTHX9/H q2JmVfqa30fFrUPWu5IJ244DST67oWX7jDTDcsw12dFRm+/8ULGa4SLseYQVNmGaw1 4wUz09soUggHK+5e6wYDhlRL/8T7UOBtzsjIkAvg= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 79B3C3858C54 for ; Mon, 6 Feb 2023 22:25:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 79B3C3858C54 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316MDNNG003347 for ; Mon, 6 Feb 2023 22:25:28 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nka5b88dw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:28 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316HRftJ023743 for ; Mon, 6 Feb 2023 22:25:26 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06tvf2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:26 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPNdP44040612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:23 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11A1520075; Mon, 6 Feb 2023 22:25:23 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C24BD20074; Mon, 6 Feb 2023 22:25:22 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:22 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 02/11] libasm: Fix xdefault_pattern initialization Date: Mon, 6 Feb 2023 23:25:04 +0100 Message-Id: <20230206222513.1773039-3-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: FMJZebUZ9qeuD8m4McTfNXuc4qadr40J X-Proofpoint-ORIG-GUID: FMJZebUZ9qeuD8m4McTfNXuc4qadr40J X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxscore=0 bulkscore=0 mlxlogscore=930 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" clang complains: asm_newscn.c:48:22: error: field 'pattern' with variable sized type 'struct FillPattern' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] struct FillPattern pattern; ^ Fix by using a union instead. Define the second union member to be a char array 1 byte larger than struct FillPattern. This should be legal according to 6.7.9: If an object that has static or thread storage duration is not initialized explicitly, then ... if it is a union, the first named member is initialized (recursively) according to these rules, and any padding is initialized to zero bits. Signed-off-by: Ilya Leoshkevich --- libasm/asm_newscn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c index d258d969..32a3b598 100644 --- a/libasm/asm_newscn.c +++ b/libasm/asm_newscn.c @@ -43,17 +43,16 @@ /* Memory for the default pattern. The type uses a flexible array which does work well with a static initializer. So we play some dirty tricks here. */ -static const struct +static const union { struct FillPattern pattern; - char zero; + char zeroes[sizeof(struct FillPattern) + 1]; } xdefault_pattern = { .pattern = { .len = 1 }, - .zero = '\0' }; const struct FillPattern *__libasm_default_pattern = &xdefault_pattern.pattern; From patchwork Mon Feb 6 22:25:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64379 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9F1C385B515 for ; Mon, 6 Feb 2023 22:26:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9F1C385B515 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722362; bh=9h1l7vYLA1tht5NpLnQE0ZQu1BsPN3/xQjVWUs9Pfcc=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=OSvL7NOmi/AkpcbNj5A4SOh3OU4qqL0nYowt8ZR9cntSxPL09t3sjxU26shvmtP6A FViZyqsAFq+R5aB8YzdPmcc1jiYABR1CYw/ZHk1h2EPfJe3B3403tzMxDLZJtJE9pK eoUyDDssCaLrQ2IjQXDzBTeCAcdgtK+sN7uDZXWE= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id DB500385840C for ; Mon, 6 Feb 2023 22:25:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB500385840C Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316LBUIb022111 for ; Mon, 6 Feb 2023 22:25:31 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk98d1r04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:30 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316GRFQH002355 for ; Mon, 6 Feb 2023 22:25:28 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06jutm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:28 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPORE24641878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:25 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD61920075; Mon, 6 Feb 2023 22:25:24 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8302120074; Mon, 6 Feb 2023 22:25:24 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:24 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 03/11] printversion: Fix unused variable Date: Mon, 6 Feb 2023 23:25:05 +0100 Message-Id: <20230206222513.1773039-4-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QJf-hcO3dQINehVT-4X0rEfXMhSQkbCx X-Proofpoint-ORIG-GUID: QJf-hcO3dQINehVT-4X0rEfXMhSQkbCx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=974 impostorscore=0 mlxscore=0 priorityscore=1501 phishscore=0 adultscore=0 suspectscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" clang complains: debuginfod.cxx:354:1: error: unused variable 'apba__' [-Werror,-Wunused-const-variable] ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT; ^ ../lib/printversion.h:47:21: note: expanded from macro 'ARGP_PROGRAM_BUG_ADDRESS_DEF' const char *const apba__ __asm ("argp_program_bug_address") ^ This is as expected: it's used by argp via the "argp_program_bug_address" name, which is not visible on the C level. Add __attribute__ ((used)) to make sure that the compiler emits it. Signed-off-by: Ilya Leoshkevich --- lib/printversion.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/printversion.h b/lib/printversion.h index a9e059ff..d1c3a987 100644 --- a/lib/printversion.h +++ b/lib/printversion.h @@ -44,6 +44,7 @@ void print_version (FILE *stream, struct argp_state *state); void (*const apvh) (FILE *, struct argp_state *) \ __asm ("argp_program_version_hook") #define ARGP_PROGRAM_BUG_ADDRESS_DEF \ - const char *const apba__ __asm ("argp_program_bug_address") + const char *const apba__ __asm ("argp_program_bug_address") \ + __attribute__ ((used)) #endif // PRINTVERSION_H From patchwork Mon Feb 6 22:25:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64381 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 944393858000 for ; Mon, 6 Feb 2023 22:26:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 944393858000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722373; bh=kP81yPbc/MLwQoflFxLnwJGf/nCHweZaJnsKiFo9ngU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=YBcEKxgE67JrSHFYgKYBpMKVYZGA3fRLujV8al6SbLw9G8ylY20nnDyOen+K4+6PU DgtN/4tc6Q//cfqSBS2t0nCuO5Rc07Hrv8QS5nWd7pxhqmY01jQYEQPZmi9Z7ngwQX XzR/cznfWeuXLIa93Sa4A3JmKr1IDxaitRCOo5x0= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 74D8E385842D for ; Mon, 6 Feb 2023 22:25:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74D8E385842D Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316Ljmqb018859 for ; Mon, 6 Feb 2023 22:25:32 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9rhrwam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:32 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316Dr1cE015745 for ; Mon, 6 Feb 2023 22:25:30 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3nhf06j1jd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:29 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPQwb25887008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:26 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 678F920076; Mon, 6 Feb 2023 22:25:26 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D24D20074; Mon, 6 Feb 2023 22:25:26 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:26 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 04/11] readelf: Fix set but not used parameter Date: Mon, 6 Feb 2023 23:25:06 +0100 Message-Id: <20230206222513.1773039-5-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: LyGhodErdaZhKeHYs2I_PI4hlJi0F5UH X-Proofpoint-ORIG-GUID: LyGhodErdaZhKeHYs2I_PI4hlJi0F5UH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 clxscore=1015 mlxlogscore=836 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" clang complains: readelf.c:12205:72: error: parameter 'desc' set but not used [-Werror,-Wunused-but-set-parameter] handle_bit_registers (const Ebl_Register_Location *regloc, const void *desc, ^ Apparently handle_bit_registers() is unimplemented, but one line is still written for the future. Silence the warning by casting desc to void. Signed-off-by: Ilya Leoshkevich --- src/readelf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/readelf.c b/src/readelf.c index 51b0e8b9..f09c5c9b 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -12206,6 +12206,7 @@ handle_bit_registers (const Ebl_Register_Location *regloc, const void *desc, unsigned int colno) { desc += regloc->offset; + (void)desc; abort (); /* XXX */ return colno; From patchwork Mon Feb 6 22:25:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64374 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 527A43858C1F for ; Mon, 6 Feb 2023 22:25:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 527A43858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722346; bh=WIwl9oiqjttjzXBScfqQiLaOts+Ts0YWriSFNwpaJAY=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=I79WIfLfPeDlcRmMmZmcGzTjNstLtPK2SMvJm6PTPX5rQaP70uR61eB7rwg1SOCuU 6SDjg07wSsk6sp/Az1PivgwkcONn2OHtoFn9rPpDMFXeXHuzZRbmCe9p+qeIMIkefE mfHnYAvGqGjwHf7auivb3HnVdq1CFUCWaOX7Z6rw= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 51F123858D1E for ; Mon, 6 Feb 2023 22:25:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51F123858D1E Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316LVfEm037731 for ; Mon, 6 Feb 2023 22:25:34 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9hvs4ya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:33 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3161VF96027110 for ; Mon, 6 Feb 2023 22:25:31 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3nhf06t1b1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:31 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPSiU47776106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:28 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5CC020074; Mon, 6 Feb 2023 22:25:27 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9741E20076; Mon, 6 Feb 2023 22:25:27 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:27 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 05/11] readelf: Fix set but not used variable Date: Mon, 6 Feb 2023 23:25:07 +0100 Message-Id: <20230206222513.1773039-6-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: R75a2f5Ybn3D9vaSCyoT3JjLcH21Y0w_ X-Proofpoint-GUID: R75a2f5Ybn3D9vaSCyoT3JjLcH21Y0w_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=813 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" clang complains: readelf.c:10250:10: error: variable 'nculist' set but not used [-Werror,-Wunused-but-set-variable] size_t nculist = 0; ^ Fix by deleting it. Signed-off-by: Ilya Leoshkevich --- src/readelf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/readelf.c b/src/readelf.c index f09c5c9b..76ca65f5 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -10247,7 +10247,6 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)), Dwarf_Off ncu = 0; size_t hsize; struct mac_culist *culist = NULL; - size_t nculist = 0; while (dwarf_nextcu (dbg, offset = ncu, &ncu, &hsize, NULL, NULL, NULL) == 0) { Dwarf_Die cudie; @@ -10268,7 +10267,6 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)), newp->files = NULL; newp->next = culist; culist = newp; - ++nculist; } const unsigned char *readp = (const unsigned char *) data->d_buf; From patchwork Mon Feb 6 22:25:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64376 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 262C13858032 for ; Mon, 6 Feb 2023 22:25:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 262C13858032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722349; bh=DfH/TxOI+lr+duP+WJOmRe1UPBGlY4pkGNom8bIZ0jw=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=mFaroizH0OZiONBiyfqdNzgVGmNCKQV3I5h5K1G66DZslvztskXvXqX2PHyCdlu2M pAmtLhqagl2lBalXfK1fJrOHN8aQ3k2hLLK6aS3MI3PwBPyxgzsgg/38k/V4KCrtZA w9NikVE00E99E/BKhcHfpifCDJayoie8XR6SK2ms= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 51191385843D for ; Mon, 6 Feb 2023 22:25:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51191385843D Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316Jg1un029793 for ; Mon, 6 Feb 2023 22:25:35 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk7x9bq0x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:34 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316HMtTO001926 for ; Mon, 6 Feb 2023 22:25:32 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06jutn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:32 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPT7K41288000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:29 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48D4020076; Mon, 6 Feb 2023 22:25:29 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EFE4520074; Mon, 6 Feb 2023 22:25:28 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:28 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 06/11] Initialize reglocs for VMCOREINFO Date: Mon, 6 Feb 2023 23:25:08 +0100 Message-Id: <20230206222513.1773039-7-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: q_HoCzG5fjowhNy2VLtl25OpNwVinIGe X-Proofpoint-GUID: q_HoCzG5fjowhNy2VLtl25OpNwVinIGe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=770 impostorscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" MSan complains: Uninitialized value was created by an allocation of 'reglocs' in the stack frame #0 0x562d35c686f0 in handle_core_note elfutils/src/readelf.c:12674:3 #const Ebl_Register_Location *reglocs; ==1006199==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x562d35c68a2a in handle_core_note elfutils/src/readelf.c:12692:11 #colno = handle_core_registers (ebl, ebl->elf, desc + regs_offset, # reglocs, nregloc); Strictly speaking, this is not a problem, because nregloc == 0, but for other note types we initialize it anyway, so do it here as well. Signed-off-by: Ilya Leoshkevich --- backends/linux-core-note.c | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c index 9faae4c3..238ec16d 100644 --- a/backends/linux-core-note.c +++ b/backends/linux-core-note.c @@ -239,6 +239,7 @@ EBLHOOK(core_note) (const GElf_Nhdr *nhdr, const char *name, return 0; *regs_offset = 0; *nregloc = 0; + *reglocs = NULL; *nitems = 1; *items = vmcoreinfo_items; return 1; From patchwork Mon Feb 6 22:25:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64375 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A8064385B52D for ; Mon, 6 Feb 2023 22:25:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8064385B52D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722347; bh=TTvMJDQgaiMHIF5flesuPFXZOY6nok+Ipmf1Cr2gqdc=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=Xa09bJDJ0O4CTuFYxv9Ob1OqhcdfYNo0WYSmtVKd8ZWAufFC6qgCdfY9CRUr0vwxe qP66U6F45q3fTuEcaWtLlgvfbZ/2xn83T7mrLNTAxOlQzGQWFx95909EIPa24NMGWQ Mc8ZR6lC53ynD3PRPG6HzUBo0AFwjBM1HVRcyLQI= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C3C6B385828D for ; Mon, 6 Feb 2023 22:25:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3C6B385828D Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316MDL04003281 for ; Mon, 6 Feb 2023 22:25:36 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nka5b88g8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:36 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 315K8iAN019913 for ; Mon, 6 Feb 2023 22:25:34 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3nhf06t1r0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:34 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPUPK44040628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:31 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD51A20074; Mon, 6 Feb 2023 22:25:30 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F2B420076; Mon, 6 Feb 2023 22:25:30 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:30 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 07/11] addr2line: Do not test demangling in run-addr2line-i-test.sh Date: Mon, 6 Feb 2023 23:25:09 +0100 Message-Id: <20230206222513.1773039-8-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: cT__sPwT2bwFUgO8YnoErG0JOpf6p0bR X-Proofpoint-ORIG-GUID: cT__sPwT2bwFUgO8YnoErG0JOpf6p0bR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxscore=0 bulkscore=0 mlxlogscore=853 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" There is run-addr2line-i-demangle-test.sh for that. Signed-off-by: Ilya Leoshkevich --- tests/run-addr2line-i-test.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/run-addr2line-i-test.sh b/tests/run-addr2line-i-test.sh index 4f63e487..e7b89083 100755 --- a/tests/run-addr2line-i-test.sh +++ b/tests/run-addr2line-i-test.sh @@ -254,13 +254,13 @@ EOF testfiles testfile-inlines-lto -testrun_compare ${abs_top_builddir}/src/addr2line --pretty -fiC -e testfile-inlines-lto 0x1118 0x1137 <<\EOF -foobar(int) at /tmp/x.cpp:4:14 - (inlined by) foo(int) at /tmp/x.cpp:22:16 - (inlined by) fu(int) at /tmp/x.cpp:27:13 -fubar(int) at /tmp/x.cpp:10:14 - (inlined by) bar(int) at /tmp/x.cpp:16:15 - (inlined by) fu(int) at /tmp/x.cpp:27:24 +testrun_compare ${abs_top_builddir}/src/addr2line --pretty -fi -e testfile-inlines-lto 0x1118 0x1137 <<\EOF +_Z6foobari at /tmp/x.cpp:4:14 + (inlined by) _Z3fooi at /tmp/x.cpp:22:16 + (inlined by) _Z2fui at /tmp/x.cpp:27:13 +_Z5fubari at /tmp/x.cpp:10:14 + (inlined by) _Z3bari at /tmp/x.cpp:16:15 + (inlined by) _Z2fui at /tmp/x.cpp:27:24 EOF exit 0 From patchwork Mon Feb 6 22:25:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64382 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3B7213858C62 for ; Mon, 6 Feb 2023 22:26:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B7213858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722384; bh=Ri02A5Mf+HnwfkNDfbJq9wlenoTh+FjkFeNFRat5C6o=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=Jerw3UQSp28gQrGGVJeKZAwdlJtZGbjMs9M61ORNfKzVEdd19zeOcJiZZjrSmkySc vOPO1m3Ntip6c7dvrm2s9FoFRUQL2IXqpI78erDBidb+XXJWLGgh9H8FKkLwoHzEJl N78EsqLxBW3/VydjOCsBLn4UzQVuPvqPoR3iFd4M= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 74BB33858280 for ; Mon, 6 Feb 2023 22:25:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74BB33858280 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316LVf9A037696 for ; Mon, 6 Feb 2023 22:25:38 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9hvs505-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:38 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316GFhGF023803 for ; Mon, 6 Feb 2023 22:25:36 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06tvf6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:36 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPW7e40239610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:32 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 651CF20075; Mon, 6 Feb 2023 22:25:32 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1993C20074; Mon, 6 Feb 2023 22:25:32 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:32 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 08/11] x86_64_return_value_location: Support lvalue and rvalue references Date: Mon, 6 Feb 2023 23:25:10 +0100 Message-Id: <20230206222513.1773039-9-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: tsgEI6p4irKPZzpOX7-KBgdzPeGbXFQS X-Proofpoint-GUID: tsgEI6p4irKPZzpOX7-KBgdzPeGbXFQS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=948 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" On the low level, they are the same as pointers. Signed-off-by: Ilya Leoshkevich --- backends/x86_64_retval.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/x86_64_retval.c b/backends/x86_64_retval.c index f9114cb1..e668eacc 100644 --- a/backends/x86_64_retval.c +++ b/backends/x86_64_retval.c @@ -106,6 +106,8 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_enumeration_type: case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: + case DW_TAG_reference_type: + case DW_TAG_rvalue_reference_type: { Dwarf_Attribute attr_mem; if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, From patchwork Mon Feb 6 22:25:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64383 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 604663858C66 for ; Mon, 6 Feb 2023 22:26:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 604663858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722395; bh=GC2+TvpkOnSImAMW3MxSj8xwYpHecNKNQtyHB4Qw90I=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=lowsDNxB5PikAOWoL150v9rFLlTaTtuCDNxm56S27KlCKRl/u3a8RwcOmAYsF33ci xdh7jnVpRdW5FeHVZQLbaesj1EWGRK7tRTm/vGamkYk0aZehtgyW9my4K9LuVT3vnX xMi0SyCy+ItG3ysWEY1i5ACOkGMmeHcLnDIFHANk= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id DA7653858033 for ; Mon, 6 Feb 2023 22:25:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA7653858033 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316Ljo6a019010 for ; Mon, 6 Feb 2023 22:25:40 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9rhrwcm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:39 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316C0KHk021137 for ; Mon, 6 Feb 2023 22:25:37 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06jutr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:37 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPX8E26280416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:33 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBAA020076; Mon, 6 Feb 2023 22:25:33 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 818BE20074; Mon, 6 Feb 2023 22:25:33 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:33 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 09/11] configure: Use -fno-addrsig if possible Date: Mon, 6 Feb 2023 23:25:11 +0100 Message-Id: <20230206222513.1773039-10-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: bWG3muW_W_7yxSgIhgAmaQkZfdoIKf4W X-Proofpoint-ORIG-GUID: bWG3muW_W_7yxSgIhgAmaQkZfdoIKf4W X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" By default, clang produces .llvm_addrsig sections [1]. The GNU toolchain does not know how to handle them yet [2], so just ask clang not to generate them for the time being. [1] https://llvm.org/docs/Extensions.html#sht-llvm-addrsig-section-address-significance-table [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105625 Signed-off-by: Ilya Leoshkevich --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 8fe8baee..7dc9be63 100644 --- a/configure.ac +++ b/configure.ac @@ -588,6 +588,14 @@ CFLAGS="$old_CFLAGS"]) AM_CONDITIONAL(HAVE_NO_PACKED_NOT_ALIGNED_WARNING, [test "x$ac_cv_no_packed_not_aligned" != "xno"]) +AC_CACHE_CHECK([whether the compiler accepts -fno-addrsig], ac_cv_fno_addrsig, [dnl +old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -fno-addrsig -Werror" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], + ac_cv_fno_addrsig=yes, ac_cv_fno_addrsig=no) +CFLAGS="$old_CFLAGS"]) +AS_IF([test "x$ac_cv_fno_addrsig" = "xyes"], CFLAGS="$CFLAGS -fno-addrsig") + saved_LIBS="$LIBS" AC_SEARCH_LIBS([argp_parse], [argp]) LIBS="$saved_LIBS" From patchwork Mon Feb 6 22:25:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64378 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62B6A3857803 for ; Mon, 6 Feb 2023 22:25:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62B6A3857803 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722359; bh=/WhICV/E/mQZtubDzVZ1SsPkX6as62GPQCpUi1nTuG8=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=rTdkfCus9c+3UEcyjJCMDTBOspb63DL2AtKsrsoi6+NoNvwoKXO8bHQsQcNqYE20V 1DiEma75Dll2uzaxJ0PKBFqr6b1t3yUv2C+F/pOO8XMsIDBEYIwqbi7dws92ZxSZrf EIkUsgqnJZ5Ee8RZ1KeBkJiT+dzGyuRHeXzzZNd0= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 97646385B50F for ; Mon, 6 Feb 2023 22:25:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 97646385B50F Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316Ljswb019220 for ; Mon, 6 Feb 2023 22:25:41 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9rhrwd3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:41 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316HchI9020939 for ; Mon, 6 Feb 2023 22:25:39 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3nhemfjv67-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:38 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPZ7W49283490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 22:25:35 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 58ED120075; Mon, 6 Feb 2023 22:25:35 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DA3F20074; Mon, 6 Feb 2023 22:25:35 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:34 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 10/11] configure: Add --disable-demangle Date: Mon, 6 Feb 2023 23:25:12 +0100 Message-Id: <20230206222513.1773039-11-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Cmo0jitZyph85ez8j1iJ04zAVHcQ0byc X-Proofpoint-ORIG-GUID: Cmo0jitZyph85ez8j1iJ04zAVHcQ0byc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 clxscore=1015 mlxlogscore=665 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" __cxa_demangle is normally implemented in the C++ runtime library, instrumenting which for MSan is a hassle. Add a knob for disabling it. Signed-off-by: Ilya Leoshkevich --- configure.ac | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7dc9be63..6a5c38af 100644 --- a/configure.ac +++ b/configure.ac @@ -466,11 +466,17 @@ CFLAGS="$CFLAGS -D_GNU_SOURCE" AC_FUNC_STRERROR_R() CFLAGS="$old_CFLAGS" +AC_ARG_ENABLE([demangler], +AS_HELP_STRING([--disable-demangle], + [Disable libstdc++ demangle support])) + +AS_IF([test "x$enable_demangler" == xyes], AC_CHECK_LIB([stdc++], [__cxa_demangle], [dnl AC_DEFINE([USE_DEMANGLE], [1], [Defined if demangling is enabled])]) AM_CONDITIONAL(DEMANGLE, test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes") AS_IF([test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes"], - [enable_demangler=yes],[enable_demangler=no]) + [enable_demangler=yes],[enable_demangler=no]), +AM_CONDITIONAL(DEMANGLE, false)) AC_ARG_ENABLE([textrelcheck], AS_HELP_STRING([--disable-textrelcheck], From patchwork Mon Feb 6 22:25:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 64380 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5865F3858000 for ; Mon, 6 Feb 2023 22:26:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5865F3858000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675722370; bh=aEfsfkayKwTTMYUA5d66JEqCTcQ7TN6nVFOVNv60vVE=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=GOe7rHygWRU4L83+kbBT7bImFIQnV7+Pa4fQWnfY1+aKlG1aKgswBfR2++3TIf5sQ TOgVC55f58qWJxIyley+zian95sFd1nqhBBsnlvLEZMI2y4oSS6z0wNdWtsp0BJpOq YqTjZypPXVTURkqIV8zP05LkFdcnUTpYpEZpYdQo= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id D873C3858028 for ; Mon, 6 Feb 2023 22:25:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D873C3858028 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316LVfqC037753 for ; Mon, 6 Feb 2023 22:25:42 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk9hvs51b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:41 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316HgK1x023711 for ; Mon, 6 Feb 2023 22:25:39 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3nhf06tvf9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Feb 2023 22:25:39 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316MPbrF46006732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 6 Feb 2023 22:25:37 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DFEF220075; Mon, 6 Feb 2023 22:25:36 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 945C020074; Mon, 6 Feb 2023 22:25:36 +0000 (GMT) Received: from heavy.lan (unknown [9.179.9.231]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 22:25:36 +0000 (GMT) To: elfutils-devel@sourceware.org Cc: Ilya Leoshkevich Subject: [PATCH RFC 11/11] configure: Add --enable-sanitize-memory Date: Mon, 6 Feb 2023 23:25:13 +0100 Message-Id: <20230206222513.1773039-12-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230206222513.1773039-1-iii@linux.ibm.com> References: <20230206222513.1773039-1-iii@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: tX2BfftRViGXmctCAEN1omNpAAit09Td X-Proofpoint-GUID: tX2BfftRViGXmctCAEN1omNpAAit09Td X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=933 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060191 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ilya Leoshkevich via Elfutils-devel From: Ilya Leoshkevich Reply-To: Ilya Leoshkevich Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" Add support for clang Memory Sanitizer [1], which detects the usage of uninitialized values. While elfutils itself is already checked with valgrind, checking code that depends on elfutils requires elfutils to be built with MSan. MSan is not linked into shared libraries, and is linked into executables statically. Therefore, unlike the other sanitizers, MSan needs to be configured fairly early, since we need to drop -D_FORTIFY_SOURCE [2], -Wl,-z,defs and --no-undefined. Disable a few tests that run for more than 5 minutes due to test files being statically linked with MSan. [1] https://clang.llvm.org/docs/MemorySanitizer.html [2] https://github.com/google/sanitizers/issues/247 Signed-off-by: Ilya Leoshkevich --- configure.ac | 24 ++++++++++++++++++++++++ debuginfod/Makefile.am | 3 ++- libasm/Makefile.am | 3 ++- libdw/Makefile.am | 3 ++- libelf/Makefile.am | 3 ++- tests/Makefile.am | 10 +++++++++- tests/run-readelf-self.sh | 5 +++++ tests/run-strip-reloc.sh | 5 +++++ tests/run-varlocs-self.sh | 5 +++++ 9 files changed, 56 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 6a5c38af..86e156a0 100644 --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,29 @@ AC_SUBST([fpie_CFLAGS]) dso_LDFLAGS="-shared" +NO_UNDEFINED=-Wl,--no-undefined +AC_ARG_ENABLE([sanitize-memory], + AS_HELP_STRING([--enable-sanitize-memory], + [Use clang memory sanitizer]), + [use_msan=$enableval], [use_msan=no]) +if test "$use_msan" = yes; then + old_CFLAGS="$CFLAGS" + old_CXXFLAGS="$CXXFLAGS" + old_LDFLAGS="$LDFLAGS" + # -fsanitize=memory is not compatible with -D_FORTIFY_SOURCE, -Wl,-z,defs and --no-undefined + CFLAGS="$CFLAGS -fsanitize=memory -fsanitize-memory-track-origins -D_FORTIFY_SOURCE=0" + CXXFLAGS="$CXXFLAGS -fsanitize=memory -fsanitize-memory-track-origins -D_FORTIFY_SOURCE=0" + LDFLAGS="-shared" + AC_LINK_IFELSE([AC_LANG_SOURCE([int main (int argc, char **argv) { return 0; }])], use_msan=yes, use_msan=no) + AS_IF([test "x$use_msan" == xyes], + ac_cv_zdefs=no NO_UNDEFINED=, + AC_MSG_WARN([clang memory sanitizer not available]) + CFLAGS="$old_CFLAGS" CXXFLAGS="$old_CXXFLAGS") + LDFLAGS="$old_LDFLAGS" +fi +AC_SUBST(NO_UNDEFINED) +AM_CONDITIONAL(USE_MEMORY_SANITIZER, test "$use_msan" = yes) + ZDEFS_LDFLAGS="-Wl,-z,defs" AC_CACHE_CHECK([whether gcc supports $ZDEFS_LDFLAGS], ac_cv_zdefs, [dnl save_LDFLAGS="$LDFLAGS" @@ -887,6 +910,7 @@ AC_MSG_NOTICE([ run all tests under valgrind : ${use_valgrind} gcc undefined behaviour sanitizer : ${use_undefined} gcc address sanitizer : ${use_address} + clang memory sanitizer : ${use_msan} use rpath in tests : ${tests_use_rpath} test biarch : ${utrace_cv_cc_biarch} ]) diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am index f27d6e2e..125be97b 100644 --- a/debuginfod/Makefile.am +++ b/debuginfod/Makefile.am @@ -102,7 +102,8 @@ endif $(LIBDEBUGINFOD_SONAME): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS) $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -Wl,--soname,$(LIBDEBUGINFOD_SONAME) \ - -Wl,--version-script,$<,--no-undefined \ + -Wl,--version-script,$< \ + $(NO_UNDEFINED) \ -Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \ $(libdebuginfod_so_LDLIBS) @$(textrel_check) diff --git a/libasm/Makefile.am b/libasm/Makefile.am index c2b54811..1e6b63e8 100644 --- a/libasm/Makefile.am +++ b/libasm/Makefile.am @@ -64,7 +64,8 @@ libasm_so_LIBS = libasm_pic.a libasm.so: $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS) $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -Wl,--soname,$@.$(VERSION) \ - -Wl,--version-script,$<,--no-undefined \ + -Wl,--version-script,$< \ + $(NO_UNDEFINED) \ -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \ $(libasm_so_LDLIBS) @$(textrel_check) diff --git a/libdw/Makefile.am b/libdw/Makefile.am index 1b6fead4..e548f38c 100644 --- a/libdw/Makefile.am +++ b/libdw/Makefile.am @@ -114,7 +114,8 @@ libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_ libdw.so: $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS) $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -Wl,--soname,$@.$(VERSION),--enable-new-dtags \ - -Wl,--version-script,$<,--no-undefined \ + -Wl,--version-script,$< \ + $(NO_UNDEFINED) \ -Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \ $(libdw_so_LDLIBS) @$(textrel_check) diff --git a/libelf/Makefile.am b/libelf/Makefile.am index 24c25cf8..aabce43e 100644 --- a/libelf/Makefile.am +++ b/libelf/Makefile.am @@ -115,7 +115,8 @@ libelf_so_LIBS = libelf_pic.a libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS) $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -Wl,--soname,$@.$(VERSION) \ - -Wl,--version-script,$<,--no-undefined \ + -Wl,--version-script,$< \ + $(NO_UNDEFINED) \ -Wl,--whole-archive $(libelf_so_LIBS) -Wl,--no-whole-archive \ $(libelf_so_LDLIBS) @$(textrel_check) diff --git a/tests/Makefile.am b/tests/Makefile.am index 36823d94..31dd2f67 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -88,12 +88,16 @@ endif # test_nlist checks its own symbol table, and expects various symbols # to be in the order as specified in the source file. Explicitly set -# minimal CFLAGS. But add address sanitizer if in use. +# minimal CFLAGS. But add sanitizers if in use. if USE_ADDRESS_SANITIZER EXTRA_NLIST_CFLAGS=-fsanitize=address else +if USE_MEMORY_SANITIZER +EXTRA_NLIST_CFLAGS=-fsanitize=memory -fsanitize-memory-track-origins +else EXTRA_NLIST_CFLAGS= endif +endif test-nlist$(EXEEXT): test-nlist.c $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ @@ -225,6 +229,10 @@ if USE_ZSTD_COMPRESS export ELFUTILS_ZSTD = 1 endif +if USE_MEMORY_SANITIZER +export ELFUTILS_MEMORY_SANITIZER = 1 +endif + if DEBUGINFOD check_PROGRAMS += debuginfod_build_id_find # With the dummy delegation doesn't work diff --git a/tests/run-readelf-self.sh b/tests/run-readelf-self.sh index 7ffb3577..61f803fb 100755 --- a/tests/run-readelf-self.sh +++ b/tests/run-readelf-self.sh @@ -17,5 +17,10 @@ . $srcdir/test-subr.sh +if test -n "$ELFUTILS_MEMORY_SANITIZER"; then + echo "binaries statically linked memory sanitizer are too big" + exit 77 +fi + # Just makes sure readelf doesn't crash testrun_on_self_quiet ${abs_top_builddir}/src/readelf -a -w diff --git a/tests/run-strip-reloc.sh b/tests/run-strip-reloc.sh index 033ed278..31a11fa2 100755 --- a/tests/run-strip-reloc.sh +++ b/tests/run-strip-reloc.sh @@ -17,6 +17,11 @@ . $srcdir/test-subr.sh +if test -n "$ELFUTILS_MEMORY_SANITIZER"; then + echo "binaries statically linked memory sanitizer are too big" + exit 77 +fi + testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko \ hello_aarch64.ko hello_m68k.ko hello_riscv64.ko hello_csky.ko \ hello_arc_hs4.ko diff --git a/tests/run-varlocs-self.sh b/tests/run-varlocs-self.sh index 5454fc70..7d79f70e 100755 --- a/tests/run-varlocs-self.sh +++ b/tests/run-varlocs-self.sh @@ -17,6 +17,11 @@ . $srcdir/test-subr.sh +if test -n "$ELFUTILS_MEMORY_SANITIZER"; then + echo "binaries statically linked memory sanitizer are too big" + exit 77 +fi + # Make sure varlocs doesn't crash, doesn't trigger self-check/asserts # or leaks running under valgrind. testrun_on_self_exe ${abs_top_builddir}/tests/varlocs -e