From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 56FB93858D3C for ; Tue, 17 May 2022 20:08:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 56FB93858D3C Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24HK1PE1018414; Tue, 17 May 2022 20:08:25 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g4j6mrh99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 May 2022 20:08:25 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24HK1XF3019296; Tue, 17 May 2022 20:08:24 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 3g4j6mrh78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 May 2022 20:08:24 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24HJswl8014888; Tue, 17 May 2022 20:03:21 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 3g2429cqey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 May 2022 20:03:21 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24HK2hcc33227156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 May 2022 20:02:43 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 22D354C04A; Tue, 17 May 2022 20:03:17 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA9394C046; Tue, 17 May 2022 20:03:16 +0000 (GMT) Received: from heavy.ibmuc.com (unknown [9.171.25.184]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 17 May 2022 20:03:16 +0000 (GMT) From: Ilya Leoshkevich To: Tom Tromey Cc: Ulrich Weigand , Andreas Arnez , Andrew Burgess , gdb-patches@sourceware.org, Ilya Leoshkevich Subject: [PATCH v2] gdb: do not add const sections to the section map Date: Tue, 17 May 2022 22:03:08 +0200 Message-Id: <20220517200308.2535419-1-iii@linux.ibm.com> X-Mailer: git-send-email 2.35.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: F9WfTMEg4OY6MB_LXW1CUhwBXZkEde7U X-Proofpoint-ORIG-GUID: oLtYvMlXl0mvu4qiaME3_bS6-vsGzsjz Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-17_03,2022-05-17_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 adultscore=0 clxscore=1011 bulkscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205170115 X-Spam-Status: No, score=-12.1 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, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2022 20:08:30 -0000 From: Ulrich Weigand build_objfile_section_table () creates four synthetic sections, which significantly slow down section map sorting. This is especially noticeable when debugging JITs that report a lot of objfiles. Since these sections are not useful for find_pc_section (), do not add them to the section map. --- v1: https://sourceware.org/pipermail/binutils/2022-May/120863.html v1 -> v2: Fix code style, post to the correct mailing list (Andrew). gdb/objfiles.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 80f68fda1c1..8a297c57530 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -1005,6 +1005,11 @@ insert_section_p (const struct bfd *abfd, if ((bfd_section_flags (section) & SEC_THREAD_LOCAL) != 0) /* This is a TLS section. */ return 0; + if (bfd_is_const_section (section)) + { + /* This is one of the global *ABS*, *UND*, *IND*, or *COM* sections. */ + return 0; + } return 1; } -- 2.35.1