public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Tom Tromey <tromey@adacore.com>
Cc: Ulrich Weigand <ulrich.weigand@de.ibm.com>,
	Andreas Arnez <arnez@linux.ibm.com>,
	Andrew Burgess <aburgess@redhat.com>,
	gdb-patches@sourceware.org, Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH v2] gdb: do not add const sections to the section map
Date: Tue, 17 May 2022 22:03:08 +0200	[thread overview]
Message-ID: <20220517200308.2535419-1-iii@linux.ibm.com> (raw)

From: Ulrich Weigand <ulrich.weigand@de.ibm.com>

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


             reply	other threads:[~2022-05-17 20:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 20:03 Ilya Leoshkevich [this message]
2022-05-23 17:07 ` Andrew Burgess
2022-05-23 17:22   ` Andrew Burgess
2022-05-23 19:13   ` Pedro Alves
2022-05-24  8:17     ` Andrew Burgess
2022-05-24  8:53       ` Ilya Leoshkevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220517200308.2535419-1-iii@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=aburgess@redhat.com \
    --cc=arnez@linux.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    --cc=ulrich.weigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).