| Message ID | 20260401144007.4026084-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 106444BA23C7 for <patchwork@sourceware.org>; Wed, 1 Apr 2026 14:41:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 106444BA23C7 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=zzhrlUIS X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazlp170120001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c10d::1]) by sourceware.org (Postfix) with ESMTPS id 041E14BA2E0D for <gdb-patches@sourceware.org>; Wed, 1 Apr 2026 14:40:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 041E14BA2E0D 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 041E14BA2E0D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c10d::1 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775054436; cv=pass; b=nqfeMv05KfLPZL39STGVnGKxzhrthlpV3eseOEznZsmJBTKEQxN4Ua1oUdF6H5GzV2rQVI3tN7VYbStZA41dj4DL8YVs2FzZeRITe0Dt8Sv4h45wqMfFy5BXXSMVrQkErCv2izNbW4KiCkgU0S9UxRse81HuItcPJbAM56Iao70= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775054436; c=relaxed/simple; bh=eqHV4ttM3Eh2VyGiKOC6GHqTtx3TWmpb8917kzDGXlA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bowSNsb3sgvDeWGSGOKqvSWwZ5VaIOOxrVH7oadwwcVgQguurt/ucbUAaHGIcac2pDdC2GEvsM+X7OrY/hl/ipYJG7/sK9cp3nNtNkRxONf6OnQw74ncCdUuatDif33JbLCp6adtDO4pwpes6rrJuXentaeFhpf75t/BLj0J0rI= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 041E14BA2E0D ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KZjX6IK0uqYSGcyPcwcgpnn1KlQPnsUZe6INADtQkBPxgn0W9eikjMG4A6Nyeiog6PKHWxD5E0tDtmtYF3yYdtvrwMlgpPg/Lv93jqJpDfwSL2HOBKwKdjuehkNgtsWVtZNzbvB2yRsleo6h/le5e8oGcwibf1PkWJHP6G5fMQxfMFy3mspg7T3t7wrbLymIWHUN++rVPUI5CQ8AzKfrM5IcDUu23NloEtPLwa7lZ5LACPoDJTH68AuRke9X4kBvA0/5AKlZQsFe3YQS3KjqiBI+9XLxTqeZMIyX8mjnaBPBrofOinAuR+g05gN5zDGlNFKV1xfTNoMtp0VWB7UW2A== 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=v5A/qKD6isnuekxrlv/FIJTqY8jTxKgsj48CxFwAzOc=; b=KAHXI+3rrUQkOgrOmO10VcPl+hQn4LPxz5VaZ4EsTBp4RYbciQHnRKh0hbe6kgOtmZKnFZj1S3tVQlZE8Z4d/ZtA841JgXlf8d0tKI89q0anZD8eUkyHInfSr52dWRtaayGYNTbcAkq8AJTFWTZDlMqs019cfrDfAJ8+UWzxQt9MOjFSnpa8mU3G4pd11LWInfAiHCqI/B0w91OB4e0uMnseJnWPsTaPM2OnRwHzTmNQDGD+1xjs6ZaF6D3NObKDG2JsOUtz93xHeKDgoTSg8fVPX2ArSizIad7wz9jVEvoxL0Sb75MHK2FWlvw+2vamGJJOb/nuvEsnDTZndq+76w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.de 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=v5A/qKD6isnuekxrlv/FIJTqY8jTxKgsj48CxFwAzOc=; b=zzhrlUIS1BQfv+Rj8NuR5zKDOkO7qReGIidaRNJHvyAgSO9/4VgIADGllCGP7NE9YdmSs/u8PgceztnYuC12K5zsXbtBbRH35M6ha5xyUxy2l/nBFifar+BuBFFsaqpe/kpMW9CulNmgLMZmm3lcom6asWKDda45C0xNj4a8Pg4= Received: from PH1PEPF000132F0.NAMP220.PROD.OUTLOOK.COM (2603:10b6:518:1::33) by IA0PR12MB8839.namprd12.prod.outlook.com (2603:10b6:208:493::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.16; Wed, 1 Apr 2026 14:40:28 +0000 Received: from CY4PEPF0000FCBE.namprd03.prod.outlook.com (2a01:111:f403:f910::1) by PH1PEPF000132F0.outlook.office365.com (2603:1036:903:47::3) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.28 via Frontend Transport; Wed, 1 Apr 2026 14:40:27 +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 CY4PEPF0000FCBE.mail.protection.outlook.com (10.167.242.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17 via Frontend Transport; Wed, 1 Apr 2026 14:40:27 +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; Wed, 1 Apr 2026 09:40:25 -0500 From: Bratislav Filipovic <bfilipov@amd.com> To: <tdevries@suse.de> CC: <bfilipov@amd.com>, <gdb-patches@sourceware.org>, <simon.marchi@efficios.com> Subject: [PATCH] testsuite: ada-valprint-error relocation issue Date: Wed, 1 Apr 2026 19:40:35 +0530 Message-ID: <20260401144007.4026084-1-bfilipov@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <82b0b090-0f2e-4abc-9e74-6d4ce3d242f4@suse.de> References: <82b0b090-0f2e-4abc-9e74-6d4ce3d242f4@suse.de> 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: CY4PEPF0000FCBE:EE_|IA0PR12MB8839:EE_ X-MS-Office365-Filtering-Correlation-Id: 27b6a512-2609-4fb4-4478-08de8ffc9dd2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700016|82310400026|1800799024|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 1o9sknFqYTS6spUqH02GEFaRjl8B0vgAedj5Ebx/oiwbumuRlUVFV60rNrkbbtiZvzmu1Tgc81znwSqk0m1I7BRIOXy1lD8J78YZ7BiAk2mo9HlFQ69w0ro98yYrW1GkRWfIkLJDyLHnGPu6p3kXktjnCVM/oLiJIkn5P7n8+KvY0rekHpPek7tfksv01hAQI8WLW4XJe+lI8Ml0K/yhYpFHrAUlMObeWLiEVs4eeOYDiV4+pLtP9F0pilOXfD7FVmrEXNvHWuUCTm37rIrzN3cVTwRiBHuNJzNtUMRVcSA5Pkg5yTTrsKypg0C1QTyQKGTuzawrhL0rfkjxBRjRBQgKnsci+WW2s3SIWJIyPV7vg8jzPDmLJ8Ft0a/1y2WPyzE8JswQylcq+VQ5zTs8TkgroHFdX080wsZPJ8tyw6ChvHVqGmKp7Ukf1OSWwIFZDcqQt2SjKj99GIqPE46krk2EHBr0aTKlALf8iUdHOlZCL5qy/MeHp7uW54ZNO896ghvHXTMuSQ1KRHEhXAe52XxTvx8OGbN9TYYawpaFh83yi8fLX4uxIidHPaVvHEbg5wwtE50wfwO5hqH3qjr7tpoT8zIMvEkupBJTKeGNfU5kG/rTEuUB1qNVvF/VC5jL9mTs6yd18KDHU5f8jtg8tCf8ubV7u2uHn46MwKNZHvTAL0OSKwc8/v7COhAHXW/+Rpn1p6S1LL6WEG2rqQq5aa2/c4HxAABBGo4tdP2JTKGzdoMzJPI9JqwomyuQRO8s4wrACD57Vm6tzbWnbEUA+Q== 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)(376014)(36860700016)(82310400026)(1800799024)(56012099003)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UrIlJPcj4i1mGww97DlYaGjApBS+T/LxkO2rIjEnJTp2xr4muCIJIVcosUykF+kK6gtGqH9j1saSegFBQ0Ms43ro92RzH8P5uaMXt7ly64VqSm3WnE2Mbi9Wy+und440aTOWP4Mt0f+++3ARAtj4O75QKbjKEXlmv/CfEVpCD+cAG53TytkAEW33qxk4ZEM8Yt0/lUXIEQ5VwGwnrE/XhiwYKjGeWxUCee4QYdkA6OXG3EcHuE17HLv0u+58bsuoaDoPeukaQVQphpL1Zqf2Crx2mLZVnxl5/NTrCeWnK5gL5gvaAVOEUct1noAeaoQYCLQblmNETI1xw7nOkvWDon0s1Ou+AnJiuW0V0hicEpFIQMGG6oWtYvxfkrXe+3sY0fWSjkxAZJVEO5+86mi1RuIweqcmSNZlSICuGqSZs8N+wCr9Y4nvbZCq96DMfmZU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2026 14:40:27.4891 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27b6a512-2609-4fb4-4478-08de8ffc9dd2 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: CY4PEPF0000FCBE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8839 X-Spam-Status: No, score=-9.5 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, LOCAL_AUTHENTICATION_FAIL_SPF, SPF_HELO_PASS, SPF_NONE, TXREP 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 |
testsuite: ada-valprint-error relocation issue
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Build passed |
| linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Test passed |
| linaro-tcwg-bot/tcwg_gdb_check--master-arm | success | Test passed |
Commit Message
Bratislav Filipovic
April 1, 2026, 2:10 p.m. UTC
The ada-valprint-error.exp test links a nodebug .o file with a separate DWARF .o file generated by lib/dwarf.exp. This requires the linker to apply relocations for initialized pointers in the .data section. Some clang + linker combinations fail to apply these relocations, leaving fd__global as NULL instead of pointing to buffer. This causes the test to print null instead of the expected error message. Binary evidence from .comment section confirms which compiler and linker were used. Testing shows: - GCC 13 + GNU ld 2.42: PASS - clang 20 + GNU ld 2.42: FAIL - clang 22 + ld.lld 22: FAIL - clang 17/19 + GNU ld 2.45.0: PASS The failure is a linker limitation when handling this specific relocation pattern, not a GDB bug. Document this in the test file to help users understand why the test may fail with certain toolchains. --- .../gdb.dwarf2/ada-valprint-error.exp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
Comments
On 4/1/26 4:10 PM, Bratislav Filipovic wrote: > The ada-valprint-error.exp test links a nodebug .o file with a separate > DWARF .o file generated by lib/dwarf.exp. This requires the linker to > apply relocations for initialized pointers in the .data section. > > Some clang + linker combinations fail to apply these relocations, > leaving fd__global as NULL instead of pointing to buffer. This causes > the test to print null instead of the expected error message. > > Binary evidence from .comment section confirms which compiler and > linker were used. Testing shows: > - GCC 13 + GNU ld 2.42: PASS > - clang 20 + GNU ld 2.42: FAIL > - clang 22 + ld.lld 22: FAIL > - clang 17/19 + GNU ld 2.45.0: PASS > > The failure is a linker limitation when handling this specific > relocation pattern, not a GDB bug. Document this in the test file > to help users understand why the test may fail with certain toolchains. Hi, the patch LGTM, but I'm wondering, do you have a copyright assignment, or are you covered by an AMD blanket assignment perhaps? Thanks, - Tom > --- > .../gdb.dwarf2/ada-valprint-error.exp | 21 +++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > index f3d61e91..00e737bc 100644 > --- a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > +++ b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > @@ -107,6 +107,27 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \ > return -1 > } > > +# Note: This test may fail with certain clang + linker combinations > +# Specifically, clang + ld.lld can fail to apply relocations when linking > +# nodebug .o with separate DWARF .o, leaving fd__global as NULL instead > +# of pointing to buffer. The failure is a linker limitation, not a GDB bug. > +# > +# Known to fail: clang 20/22 + GNU ld 2.42, clang 22 + ld.lld 22 > +# Known to pass: GCC + GNU ld, clang 17/19 + GNU ld 2.45.0 > +set unsupported 0 > +gdb_test_multiple "print /x fd__global" "check fd__global value" { > + -re -wrap "@0x0: 0x0" { > + set unsupported 1 > + } > + -re -wrap "" { > + pass $gdb_test_name > + } > +} > +if {$unsupported} { > + unsupported "linker failed to apply relocation for fd__global" > + return > +} > + > gdb_test_no_output "set language ada" > > gdb_test "print fd.global" \
[AMD Official Use Only - AMD Internal Distribution Only] Hi Tom, Yes, blanket assignment. About pushing, I was told to ask you to push it since I've only recently started contributing and I don't have write-after-approval access. Regards Bratislav -----Original Message----- From: Tom de Vries <tdevries@suse.de> Sent: Wednesday, April 1, 2026 8:12 PM To: Filipovic, Bratislav <Bratislav.Filipovic@amd.com> Cc: gdb-patches@sourceware.org; simon.marchi@efficios.com Subject: Re: [PATCH] testsuite: ada-valprint-error relocation issue [You don't often get email from tdevries@suse.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On 4/1/26 4:10 PM, Bratislav Filipovic wrote: > The ada-valprint-error.exp test links a nodebug .o file with a > separate DWARF .o file generated by lib/dwarf.exp. This requires the > linker to apply relocations for initialized pointers in the .data section. > > Some clang + linker combinations fail to apply these relocations, > leaving fd__global as NULL instead of pointing to buffer. This causes > the test to print null instead of the expected error message. > > Binary evidence from .comment section confirms which compiler and > linker were used. Testing shows: > - GCC 13 + GNU ld 2.42: PASS > - clang 20 + GNU ld 2.42: FAIL > - clang 22 + ld.lld 22: FAIL > - clang 17/19 + GNU ld 2.45.0: PASS > > The failure is a linker limitation when handling this specific > relocation pattern, not a GDB bug. Document this in the test file to > help users understand why the test may fail with certain toolchains. Hi, the patch LGTM, but I'm wondering, do you have a copyright assignment, or are you covered by an AMD blanket assignment perhaps? Thanks, - Tom > --- > .../gdb.dwarf2/ada-valprint-error.exp | 21 +++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > index f3d61e91..00e737bc 100644 > --- a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > +++ b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp > @@ -107,6 +107,27 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \ > return -1 > } > > +# Note: This test may fail with certain clang + linker combinations # > +Specifically, clang + ld.lld can fail to apply relocations when > +linking # nodebug .o with separate DWARF .o, leaving fd__global as > +NULL instead # of pointing to buffer. The failure is a linker limitation, not a GDB bug. > +# > +# Known to fail: clang 20/22 + GNU ld 2.42, clang 22 + ld.lld 22 # > +Known to pass: GCC + GNU ld, clang 17/19 + GNU ld 2.45.0 set > +unsupported 0 gdb_test_multiple "print /x fd__global" "check > +fd__global value" { > + -re -wrap "@0x0: 0x0" { > + set unsupported 1 > + } > + -re -wrap "" { > + pass $gdb_test_name > + } > +} > +if {$unsupported} { > + unsupported "linker failed to apply relocation for fd__global" > + return > +} > + > gdb_test_no_output "set language ada" > > gdb_test "print fd.global" \
On 4/2/26 3:12 PM, Filipovic, Bratislav wrote: > Yes, blanket assignment. About pushing, I was told to ask you to push it since I've only recently started contributing and > I don't have write-after-approval access. Hi, I've pushed this, with the tag below. Thanks, - Tom Approved-By: Tom de Vries <tdevries@suse.de>
diff --git a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp index f3d61e91..00e737bc 100644 --- a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp +++ b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp @@ -107,6 +107,27 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \ return -1 } +# Note: This test may fail with certain clang + linker combinations +# Specifically, clang + ld.lld can fail to apply relocations when linking +# nodebug .o with separate DWARF .o, leaving fd__global as NULL instead +# of pointing to buffer. The failure is a linker limitation, not a GDB bug. +# +# Known to fail: clang 20/22 + GNU ld 2.42, clang 22 + ld.lld 22 +# Known to pass: GCC + GNU ld, clang 17/19 + GNU ld 2.45.0 +set unsupported 0 +gdb_test_multiple "print /x fd__global" "check fd__global value" { + -re -wrap "@0x0: 0x0" { + set unsupported 1 + } + -re -wrap "" { + pass $gdb_test_name + } +} +if {$unsupported} { + unsupported "linker failed to apply relocation for fd__global" + return +} + gdb_test_no_output "set language ada" gdb_test "print fd.global" \