From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 73C033858D3C for ; Tue, 17 May 2022 14:52:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 73C033858D3C Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-adi_7IoUPP2__FhcGHSDIQ-1; Tue, 17 May 2022 10:52:45 -0400 X-MC-Unique: adi_7IoUPP2__FhcGHSDIQ-1 Received: by mail-wr1-f71.google.com with SMTP id w4-20020adfbac4000000b0020acba4b779so4783512wrg.22 for ; Tue, 17 May 2022 07:52:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=B6R5XCrM+iC8apF6maWJQERiJASBp+5I3w6m9TpPBmA=; b=4xxAw1MsaacHjRApWBJo1LIhZAbJZ9DPespBRbqHkemGJUiUcCkPbmyY+P/gBpH2Ee SyGlx9qCOx4g2BZGLFpXmD7/MPhrPAOa6tuWo1mgqt5oZJvgj+CAMvWrztMrxYBVWvvR blgttL19X/xekaQOh1QlMAvv9dGKdpAvx78Cm/KWbwog8aYgWb6O2FJV+1LT/DMr8Wle abdrt1c4AC3rHSAo7Tx7thVMqkIn4oTIrJmAUWLYJTyAMNXares3ozIjsZxM/oGWVfPY ioyWLNhPqGAabB70z9ACnyA98SieGMn3CCSQTD+lZH1mr7v90gX1gy1VLAzi8ciTUkmT AFGQ== X-Gm-Message-State: AOAM5338vTQRZEcloTc2tFbqu6OzXZ7cYVrC8BvkA14xYw/xIMmB/9Ry m3cJnL60Kd/VZAPTi9vMLrW66DSRng3ZLzeylwBHTSZ6cquB+pTv2rTORRWMLJRbSOYEcH9iTAQ psAQKqDRPJK9Mwjyvdmijkx9Qr+YgYwvLP6rNVsySWhJuinEMnGPxIfsuzmR1u3dkSNoE0w== X-Received: by 2002:a5d:6791:0:b0:20d:c9f:6b00 with SMTP id v17-20020a5d6791000000b0020d0c9f6b00mr7079098wru.462.1652799164400; Tue, 17 May 2022 07:52:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztUx7i2gNh40clndp6h2VXaP804iaI4oTpf5JyTOTJ+a2pltG9igj/wVbAni9nSe6/6Uf6KA== X-Received: by 2002:a5d:6791:0:b0:20d:c9f:6b00 with SMTP id v17-20020a5d6791000000b0020d0c9f6b00mr7079079wru.462.1652799164117; Tue, 17 May 2022 07:52:44 -0700 (PDT) Received: from localhost (host81-136-113-48.range81-136.btcentralplus.com. [81.136.113.48]) by smtp.gmail.com with ESMTPSA id a1-20020a05600c224100b0039706782e06sm2040413wmm.33.2022.05.17.07.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 07:52:43 -0700 (PDT) From: Andrew Burgess To: Ilya Leoshkevich via Binutils , Tom Tromey Cc: Ulrich Weigand , Andreas Arnez , binutils@sourceware.org, Ilya Leoshkevich Subject: Re: [PATCH] gdb: do not add const sections to the section map In-Reply-To: <20220516194209.2470009-1-iii@linux.ibm.com> References: <20220516194209.2470009-1-iii@linux.ibm.com> Date: Tue, 17 May 2022 15:52:42 +0100 Message-ID: <87fsl8jjnp.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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: Tue, 17 May 2022 14:52:48 -0000 Ilya Leoshkevich via Binutils writes: Thanks for this. GDB patches need to be sent to gdb-patches@sourceware.org for review. > 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; You either need to a { ... } around the comment and the return, or move the comment before the `if` here. Thanks, Andrew > > return 1; > } > -- > 2.35.1