| Message ID | 20260331142934.3978473-1-bfilipov@amd.com |
|---|---|
| State | New |
| Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 26C774BB58EF for <patchwork@sourceware.org>; Tue, 31 Mar 2026 14:31:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26C774BB58EF Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=qnZ923I5 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazlp170110009.outbound.protection.outlook.com [IPv6:2a01:111:f403:c111::9]) by sourceware.org (Postfix) with ESMTPS id DD13F4B7A1D0 for <gdb-patches@sourceware.org>; Tue, 31 Mar 2026 14:29:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD13F4B7A1D0 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DD13F4B7A1D0 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c111::9 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1774967398; cv=pass; b=uEHlvcQN5z3pnUQZQcOQc3PmYWtShPARlr416m+hu9RxYmcU7jjfiWQ/ZTD97txOwhI74YjV6RMqmRXAEiIKaEuRM8JfjIv77j0ZPfhUOePyxMsM2ELTuVQMvnSvJici/OmBh2l3AK5USiUNKtN3J7PKlZ679QB3ZMbdc3FxhEw= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1774967398; c=relaxed/simple; bh=/lCxkR8Bu5fJQzk2vyWA6NdElZWYp94t5mDR/PvdNFs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=FwtJ2Fn2waLo4bZF9C+xsJ1EKExs7o0tc3qJVPcCO/0WhnE5P43EtjuKbW0oHcD4RZ5BH7E2b3mVG8ZaDM3rdEXSTWrxf7181jFjp0fVU8ypFyYhnwsCzJgicXHbcUX6bzHMuzSi0fPg1S6RMbk9z+vTDhI9+7uIeZwg2B9tuDU= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD13F4B7A1D0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vo9MWKnI/f1Fvi5DtqQ4kGKw/HoSLVR2z5oAy13Z43UFYy0FzzavuiIbbQuskw/bmz6Ywvx8aR6KHf+fLWPc0e1Ujd4WUe3u2KKssrkZAejM9E+UfdgTTmv3tsEFs6qT/cK0/iuuRQNUr+FB1u6e0UjSTWZowptwQRCbpNBmntI+fz6rA9umUV+naYPL9YJOcyRkv1f1BF1yFlmRO5fGfGLOpbv7Mfy3hePCDe6NORXF2c+9heGRlvIINgH3cSvBJyeMYUkJ59P+SHL8M9z1X+jyiNtm8ldCPzBSRTJ7P5woVMBtBDpwcvJGW74D9lVpF32v+Cqd7+k36Bx8m4Hysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4EEMESEN2sAkGwbDtB/RFWJ06DdFmqRpjhDkCqZ2GX4=; b=nTtNgUc+xjLPVbkk66fkJN7iyNMSZ1gEWy/z4YD60cmGx0v+JP1MeiukOF3DrO+BENIpBGKk96y0CDQCsFoINZJrcrSd1p517x7MC5yNo57dYYzXN2CZq9EVRFqt3b0UA4PMRI2o4rti6dL8LpSq+CvUY3+JaxKM/uCS5l27Rmr4gj2Bx+9EoItkuGCMCkLYDnbEUKHhugQHHgCzygmhx4mqgLeecO+UlOL8UYAzGA5EKZD8xOlq0mtjWvLT93qmfKvA6xudpwbO4HHC0QXBmj3axUfiEH7FnnZXLCXbC3eyKXbK6r/Ew5SoVknluNo0nhe0lQ4V66G9lofmVKMhuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4EEMESEN2sAkGwbDtB/RFWJ06DdFmqRpjhDkCqZ2GX4=; b=qnZ923I5t0I0nbEAct4YRugJqqzCitqhzSaUke9A8+vrpyvlFW6YDZHEMfwEK31LZDHr1a+4SXt6ax9fwvCbbXJ9KjWiIjfMYhKGcRg1LH+KoF1IhkR8MOgCYC4X8XD3djos45zxOCQFrHMop8FhYDFQRPVAoO1JWgPU7nRagEo= Received: from DM6PR03CA0096.namprd03.prod.outlook.com (2603:10b6:5:333::29) by BY5PR12MB4099.namprd12.prod.outlook.com (2603:10b6:a03:20f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Tue, 31 Mar 2026 14:29:52 +0000 Received: from CH3PEPF00000016.namprd21.prod.outlook.com (2603:10b6:5:333:cafe::c) by DM6PR03CA0096.outlook.office365.com (2603:10b6:5:333::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.29 via Frontend Transport; Tue, 31 Mar 2026 14:29:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CH3PEPF00000016.mail.protection.outlook.com (10.167.244.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9791.0 via Frontend Transport; Tue, 31 Mar 2026 14:29:51 +0000 Received: from rocm-BirmanPlus-KRK2e.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 31 Mar 2026 09:29:50 -0500 From: Bratislav Filipovic <bfilipov@amd.com> To: <gdb-patches@sourceware.org> CC: <simon.marchi@efficios.com>, Bratislav Filipovic <bfilipov@amd.com> Subject: [PATCH] gdb/testsuite: skip ada-valprint-error with clang Date: Tue, 31 Mar 2026 19:59:31 +0530 Message-ID: <20260331142934.3978473-1-bfilipov@amd.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000016:EE_|BY5PR12MB4099:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a6b679a-e644-4250-cd1b-08de8f31f854 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700016|1800799024|18002099003|56012099003; X-Microsoft-Antispam-Message-Info: 9zUIhMw9gRkxE0vgKqSRtSkA4G7E8UUrOQwqO9v0/wf7IZCKFLgYd80BnDjelUseRfewkdmp08GwkE65K7zYoqALCKjBiCpLllHoJrS5jlDlo4kzRNZoBqHrUdf7Vcq5iQtQyEKiAp7HNDYe3qYfBA33a89fyoScxUWRtZV++GWPDeYQ9w+5bEmeqM+DI76RRz8qNbOMYZh9sPF+XOJLYszmcicjWwCdYPQfnaGS2Z1G0IrY4IQIFoyqgKGJFmgXrSteDX7TP4zrubdCf/+j6I99VaYJU2aNVSO3MCooKMOuc4bXfQ935likqxn9ZNhSMvG/2Booog+zOTs3Rq27BxWKwBrz+hO5coi1stdkIPUJhU9faZMxDoaEFO0cFWS/wfTNzlhCbF2zhxk2eRECEfRzNqoml9b5JpFFGBvHqtv8CRLKKtMvdUDmQhtWDG7nXpA0J+k5tHLn3o+qFi/bQqCyNM6CR4A+e1OfkFOz0GZNuPtbL6SveWdI9fj3MCxc4iFPuiLoq5rtUtLlnxwNO6d35f7MD8dIgh8BRdwc4lRoOmtF3VTHkmEe41NSNtuD47Af0vMXXI7ZP4usp98FR82mT1qrvH6t/XCmr/y2sN3JVcV6AAl4cBVcd4WfXTuI0EHpprp8LNHF4Jr9+qtSFZCV2Crp2PblAHZrzQkMQ//JVNXKKiHwRDhBWVGh5PI/+xqc+a/sCBPou4m7oa9du7I8FhkM72i4OWf70/6mhkvVutekvGJyo1myjf1iq4zwr/cpFAbXMxlDoL0JhB5wbg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(376014)(36860700016)(1800799024)(18002099003)(56012099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Bxpr8UJq9aOx/8hPaKGgJTGZRF92VIgEKP35GLWFjHqjhCqqD6bIb1SHt14Bb0RW9fUfTVeVDRX6hggHE+N8yaiC5LGoTpOrUSh48EGG2jtPt0s6wkoOjCNJRo5lOTvDjDbaRNi6GR+Ur4viQCO/yyxwUELSm6B+oIEhdtdu7TZhFovVa1m5QbhPoaAm6XQjRGSepGiwqE6nfiq+iGgworS0tbAimnU1s4xyM2gDONCrAaVc2ZXU8kqFuuKa+q8P2BVWjqodxpzYtfMzTE+87kBw8K5mJ/abcdLH/EmxvRwfcmc9rRll8l2YqJU+zjUgeep0c4+9kOQ/Iqlam3sTiWjO+K0TciIQfCmFf4ODUZO+gGLRNb725fg/ObyZbW9PjR4547ONInzKFsjLZvBCSsLbGTsQS/aUP4+QdVCNs/sXB1EJzDRPF80lzfv+T+ul X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2026 14:29:51.5393 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a6b679a-e644-4250-cd1b-08de8f31f854 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000016.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4099 X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, LOCAL_AUTHENTICATION_FAIL_SPF, RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS, SPF_NONE, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
gdb/testsuite: skip ada-valprint-error with clang
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Build passed |
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_gdb_check--master-arm | success | Test passed |
| linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Test passed |
Commit Message
Bratislav Filipovic
March 31, 2026, 2:29 p.m. UTC
The ada-valprint-error.exp test fails when compiled with clang due
to a linker relocation issue in the test infrastructure, not a GDB
bug.
The test compiles ada-valprint-error.c with nodebug flags, then
links it with a separate DWARF .o file generated by lib/dwarf.exp.
The C source defines:
int buffer[] = {0, 0};
void *fd__global = &buffer;
This requires the linker to apply an R_X86_64_64 relocation to
store buffer's address into fd__global. With GCC, the linker
correctly applies this relocation. With clang, the linker fails
to apply it, leaving fd__global as NULL.
Binary evidence:
- GCC binary: fd__global = 0x4020 (correct address of buffer)
- Clang binary: fd__global = 0x0 (NULL)
Both .o files contain the R_X86_64_64 relocation entry, but the
final linked binary differs:
- GCC emits fd__global in .data.rel.local section -> relocation works
- Clang emits fd__global in .data section -> relocation fails
This appears to be a toolchain/testsuite compatibility issue when
linking nodebug object files with separate DWARF objects. Skip
the test for clang to avoid false failures.
Tested on x86_64-linux-gnu with both GCC and clang.
---
gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On 3/31/26 4:29 PM, Bratislav Filipovic wrote: > The ada-valprint-error.exp test fails when compiled with clang due > to a linker relocation issue in the test infrastructure, not a GDB > bug. > > The test compiles ada-valprint-error.c with nodebug flags, then > links it with a separate DWARF .o file generated by lib/dwarf.exp. > The C source defines: > > int buffer[] = {0, 0}; > void *fd__global = &buffer; > > This requires the linker to apply an R_X86_64_64 relocation to > store buffer's address into fd__global. With GCC, the linker > correctly applies this relocation. With clang, the linker fails > to apply it, leaving fd__global as NULL. > > Binary evidence: > - GCC binary: fd__global = 0x4020 (correct address of buffer) > - Clang binary: fd__global = 0x0 (NULL) > > Both .o files contain the R_X86_64_64 relocation entry, but the > final linked binary differs: > - GCC emits fd__global in .data.rel.local section -> relocation works > - Clang emits fd__global in .data section -> relocation fails > > This appears to be a toolchain/testsuite compatibility issue when > linking nodebug object files with separate DWARF objects. Skip > the test for clang to avoid false failures. > > Tested on x86_64-linux-gnu with both GCC and clang. > > --- > gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > index f3d61e91..c23d58a8 100644 > --- a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > +++ b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > @@ -14,6 +14,14 @@ > # along with this program. If not, see <http://www.gnu.org/licenses/>. > load_lib dwarf.exp > > +# Clang's linker fails to apply relocations when linking nodebug .o > +# with separate DWARF .o, resulting in fd__global being NULL instead > +# of pointing to buffer. > +if {[test_compiler_info "clang-*"]} { > + unsupported "clang linker relocation issue with nodebug+DWARF linking" > + return > +} Hi, I think it would be useful if you'd document what version of clang you're having this problem with. And since it's not clear to me from your explanation whether it's a compiler or linker bug, perhaps linker version as well? Also, this test-case passes for me with clang (17.0.6, 19.1.7, with ld 2.45.0), so disabling it entirely for clang seems too intrusive. How about printing the value of fd__global, and declaring the test-case unsupported if the value is nullptr? Thanks, - Tom > + > # This test can only be run on targets which support DWARF-2 and use gas. > require dwarf2_support >
diff --git a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp index f3d61e91..c23d58a8 100644 --- a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp +++ b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp @@ -14,6 +14,14 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. load_lib dwarf.exp +# Clang's linker fails to apply relocations when linking nodebug .o +# with separate DWARF .o, resulting in fd__global being NULL instead +# of pointing to buffer. +if {[test_compiler_info "clang-*"]} { + unsupported "clang linker relocation issue with nodebug+DWARF linking" + return +} + # This test can only be run on targets which support DWARF-2 and use gas. require dwarf2_support