From patchwork Mon Sep 9 21:05:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Harmstone X-Patchwork-Id: 97351 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 386253858C98 for ; Mon, 9 Sep 2024 21:06:06 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail.burntcomma.com (mail.burntcomma.com [IPv6:2a02:8012:8cf0:250::6d61:696c]) by sourceware.org (Postfix) with ESMTPS id 1C9633858D39 for ; Mon, 9 Sep 2024 21:05:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C9633858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=harmstone.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=harmstone.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1C9633858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a02:8012:8cf0:250::6d61:696c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725915940; cv=none; b=EUSfN7ZWcNJyf20X6zHJh6ETNsPcAbjSiA4sOMwlo4ZRZrpwnsp7qZpYedOzSLo0MOpJHbBqYS/fTZDm77FIuM/QMG4gTEd1dFQMYSMB1WU3tCX5jxsTYzuTnVz5ybiMaZqMb/mGo490X6eLNBTgNYZ1Gu29Sg9BJI3hpLq/C14= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725915940; c=relaxed/simple; bh=601rmAuC97t3iHe9C0OwMBPodRYoFdMb+qk1nDu+gEQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:Mime-Version; b=rkN1NJ8Rvb5K6eaAPFbU9rca/ib/YbPzRWStH2gk5KtEXdtVS7q1ajBAeSj5fGt/mvqqrpgkyYxqfuIaQwSQcNtQHi1jFHj9wSm8Mvy+YDbMxJmpkI46G0PAefwoZSnSeSHdRJXm+di9YPrP+URdQkCcihaePcHbxIZmMeWJoFY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost.localdomain (unknown [IPv6:2a02:8012:8cf0:0:b62e:99ff:fee9:ad9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail.burntcomma.com (Postfix) with ESMTPSA id 5A8881D4A59; Mon, 9 Sep 2024 22:05:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=harmstone.com; s=mail; t=1725915938; bh=FcE6cYMXTKowglnQsGcWWNjSnnXxPxWksXpDHFGPpqg=; h=From:To:Cc:Subject:Date; b=XGYL0qkek76vyCSCplGDhNyFvknaDBogPJW9HF18t7PryX/XwlCL8WY3Z1B032rQL eeMuEXej8sPO38NgKXjLyJUFX7ODy4GBvOIqBTTzFun/u/nfJV8qplmYK+u0sFGJ5f cYZ5v6EH/d97r28eIDraekoiwRBqQ1ZzlutAOiMI= From: Mark Harmstone To: jbeulich@suse.com, binutils@sourceware.org Cc: Mark Harmstone Subject: [PATCH] ld/testsuite: exclude relocs from section contributions PDB test Date: Mon, 9 Sep 2024 22:05:27 +0100 Message-ID: <20240909210533.4853-1-mark@harmstone.com> Mime-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org A bug in ld meant that we were erroneously generating image relocations for .secrel32 ops, which we then reflected in our PDB section contributions because the linker was adding a .reloc section. This was incidental to what we were testing for, so pass --disable-reloc-section to ld in order to ensure a consistent output. --- ld/testsuite/ld-pe/pdb.exp | 22 +--------------------- ld/testsuite/ld-pe/pdb2-section-contrib.d | 4 +--- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/ld/testsuite/ld-pe/pdb.exp b/ld/testsuite/ld-pe/pdb.exp index 7ca0fb66246..b530e0a639d 100644 --- a/ld/testsuite/ld-pe/pdb.exp +++ b/ld/testsuite/ld-pe/pdb.exp @@ -611,26 +611,6 @@ proc test_mod_info { mod_info } { if { [expr $off % 4] != 0 } { set off [expr $off + 4 - ($off % 4)] } - - incr off 64 - - set obj3 [string range $mod_info $off [expr [string first \000 $mod_info $off] - 1]] - incr off [expr [string length $obj3] + 1] - - set ar3 [string range $mod_info $off [expr [string first \000 $mod_info $off] - 1]] - incr off [expr [string length $ar3] + 1] - - if [string equal $obj3 "* Linker *"] { - pass "Correct name for dummy object file" - } else { - fail "Incorrect name for dummy object file" - } - - if [string equal $ar3 ""] { - pass "Correct archive name for dummy object file" - } else { - fail "Incorrect archive name for dummy object file" - } } proc test_section_contrib { section_contrib } { @@ -677,7 +657,7 @@ proc test2 { } { return } - if ![ld_link $ld "tmpdir/pdb2.exe" "--pdb=tmpdir/pdb2.pdb --gc-sections -e foo tmpdir/pdb2a.o tmpdir/pdb2b.a"] { + if ![ld_link $ld "tmpdir/pdb2.exe" "--pdb=tmpdir/pdb2.pdb --gc-sections --disable-reloc-section -e foo tmpdir/pdb2a.o tmpdir/pdb2b.a"] { unsupported "Create PE image with PDB file" return } diff --git a/ld/testsuite/ld-pe/pdb2-section-contrib.d b/ld/testsuite/ld-pe/pdb2-section-contrib.d index 5b1df9fd931..214eb11d3fb 100644 --- a/ld/testsuite/ld-pe/pdb2-section-contrib.d +++ b/ld/testsuite/ld-pe/pdb2-section-contrib.d @@ -7,6 +7,4 @@ Contents of section .data: 0020 01000000 10000000 10000000 20000060 ............ ..` 0030 01000000 00000000 00000000 02000000 ................ 0040 00000000 3d000000 40000040 00000000 ....=...@..@.... - 0050 00000000 00000000 04000000 00000000 ................ - 0060 0c000000 40000042 02000000 00000000 ....@..B........ - 0070 00000000 .... + 0050 00000000 00000000 ........