public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] gdb: do not add const sections to the section map
@ 2022-05-17 20:03 Ilya Leoshkevich
  2022-05-23 17:07 ` Andrew Burgess
  0 siblings, 1 reply; 6+ messages in thread
From: Ilya Leoshkevich @ 2022-05-17 20:03 UTC (permalink / raw)
  To: Tom Tromey
  Cc: Ulrich Weigand, Andreas Arnez, Andrew Burgess, gdb-patches,
	Ilya Leoshkevich

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-24  8:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 20:03 [PATCH v2] gdb: do not add const sections to the section map Ilya Leoshkevich
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

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).