public inbox for binutils@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>,
	binutils@sourceware.org, Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH] gdb: do not add const sections to the section map
Date: Mon, 16 May 2022 21:42:09 +0200	[thread overview]
Message-ID: <20220516194209.2470009-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.
---
 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


             reply	other threads:[~2022-05-16 19:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 19:42 Ilya Leoshkevich [this message]
2022-05-17 14:52 ` Andrew Burgess
2022-05-19 15:10 ` Tom Tromey
2022-05-19 17:37   ` 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=20220516194209.2470009-1-iii@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=arnez@linux.ibm.com \
    --cc=binutils@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).