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 03A0A3856244 for ; Mon, 16 May 2022 19:42:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 03A0A3856244 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24GIBu4J016356; Mon, 16 May 2022 19:42:20 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g3up69mxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 19:42:20 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24GJg9UY015170; Mon, 16 May 2022 19:42:18 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04fra.de.ibm.com with ESMTP id 3g2428tgab-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 May 2022 19:42:18 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24GJfgRu24510788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 May 2022 19:41:42 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 746CFA404D; Mon, 16 May 2022 19:42:13 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B59AA4040; Mon, 16 May 2022 19:42:13 +0000 (GMT) Received: from heavy.ibmuc.com (unknown [9.171.25.184]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 16 May 2022 19:42:13 +0000 (GMT) From: Ilya Leoshkevich To: Tom Tromey Cc: Ulrich Weigand , Andreas Arnez , binutils@sourceware.org, Ilya Leoshkevich Subject: [PATCH] gdb: do not add const sections to the section map Date: Mon, 16 May 2022 21:42:09 +0200 Message-Id: <20220516194209.2470009-1-iii@linux.ibm.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 39VZJnzsmKONKO0G9pSsSDUg5CrYls65 X-Proofpoint-ORIG-GUID: 39VZJnzsmKONKO0G9pSsSDUg5CrYls65 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-16_15,2022-05-16_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 clxscore=1011 mlxscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=909 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205160106 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2022 19:42:24 -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. --- gdb/objfiles.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 80f68fda1c1..259c19584a6 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -1005,6 +1005,9 @@ 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