From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 94FBA38582AE for ; Sat, 16 Dec 2023 04:02:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94FBA38582AE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94FBA38582AE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702699373; cv=none; b=oFntvFVRdcyFqWOfxtHLxW4a76PtcAG4QyOnIEQNvSLsMvTL8B1ZYcQ8gxcwDLi9Au5F8hiozBQ2lc3JHFq/tXfMTMH810fZW1FCSjse+iuM2mOFbYZahrrHk89C9NyriTw/KVkSV+ljupmavzlBwIZL7427Z3LLOkELDA3tvs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702699373; c=relaxed/simple; bh=ij8fWhTu+Qa2rw6cU7F/+UqsSX9tOzIxG9rXyozRr4k=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Y9C8uW57KTQNyzc7UpbBzoPCffv0DNKa7uW0+S1ly2IsgeLEmyiOJM8Zca5sVyfGOK0YKMNzlzRqnfkGQaW6wc6uP6RpX9bW68ig6D5NY0+ndZBi+e4yzgKSgrl4OyNdchR2YLsFmDgs10/G49c+THumeUzXfS6Jsqkz/LPygO0= ARC-Authentication-Results: i=1; server2.sourceware.org From: Sam James To: binutils@sourceware.org Cc: nickc@redhat.com Subject: [2.41 PATCH 02/10] Fix "--only-keep-debug for ELF relocatables" binutils test for compilers which add .debug_macro sections to object files. Date: Sat, 16 Dec 2023 04:01:25 +0000 Message-ID: <20231216040239.1981071-3-sam@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216040239.1981071-1-sam@gentoo.org> References: <20231216040239.1981071-1-sam@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Nick Clifton PR 30699 * binutils/testsuite/binutils-all/objcopy.exp (keep_debug_symbols_for_elf_relocatable): Do not add sections containing the string "debug_" to the list of non-debug sections. (cherry picked from commit b99a9693430a9f04165b1b868f890b622bb1b46c) --- binutils/testsuite/binutils-all/objcopy.exp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 1145835d8b7..41070c3e0de 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1028,7 +1028,11 @@ proc keep_debug_symbols_for_elf_relocatable { prog flags test } { {[^a-zA-Z]+([a-zA-Z0-9_\.]+)[ \t]+([A-Z]+)[ \t]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9]+[ \t]+([A-Z]*)[ \t]+[0-9]+(.*)} \ $got all name type flag rest] } { if { $type != "NOTE" && [regexp {[AG]} $flag] } { - lappend non_debug_sections $name + # PR 30699: Some debug sections can be in a group, so + # exclude sections whose name includes "debug_" + if { ! [regexp {debug_} $name] } { + lappend non_debug_sections $name + } } set got $rest } @@ -1086,6 +1090,7 @@ switch [copy_setup] { untested $test5 if [is_elf_format] { untested $test6 + untested $test7 } } "3" { -- 2.43.0