public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Drop .debug_gnu_{names,types} sections
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20190705141941.GA20149@delia> (raw)

Hi,

When using -ggnu-pubnames to generate .debug_gnu_{names,types} sections we run
into:
...
$ gcc hello.c -g -ggnu-pubnames
$ dwz a.out
dwz: a.out: Unknown debugging section .debug_gnu_pubnames
...

Fix this conservatively by dropping the section, similar to how the
.debug_{names,types} sections are handled.

Committed to trunk.

Thanks,
- Tom

Drop .debug_gnu_{names,types} sections

2019-07-05  Tom de Vries  <tdevries@suse.de>

	PR dwz/24771
	* dwz.c (enum debug_section_kind): Add DEBUG_GNU_PUBNAMES and
	DEBUG_GNU_PUBTYPES.
	(debug_sections): Add entries for .debug_gnu_pubnames and
	.debug_gnu_pubtypes.
	(dwz): Drop .debug_gnu_{names,types} sections.
	* Makefile (TEST_EXECS): Add hello-gnu-pubnames.
	(hello-gnu-pubnames): New target
	* testsuite/dwz.tests/pr24771.sh: New test.

---
 Makefile                       | 5 ++++-
 dwz.c                          | 8 ++++++++
 testsuite/dwz.tests/pr24771.sh | 9 +++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 534fc74..df7fb17 100644
--- a/Makefile
+++ b/Makefile
@@ -25,11 +25,14 @@ PWD:=$(shell pwd -P)
 TEST_SRC = $(srcdir)/testsuite/dwz.tests
 TEST_EXECS = hello dw2-restrict py-section-script dwz-for-test min two-typedef \
 	dw2-skip-prologue start implptr-64bit-d2o4a8r8t0 hello-gold-gdb-index \
-	start-gold
+	start-gold hello-gnu-pubnames
 
 hello:
 	$(CC) $(TEST_SRC)/hello.c -o $@ -g
 
+hello-gnu-pubnames:
+	$(CC) $(TEST_SRC)/hello.c -o $@ -g -ggnu-pubnames
+
 dw2-restrict:
 	$(CC) -no-pie $(TEST_SRC)/dw2-restrict.S -o $@ || touch $@
 
diff --git a/dwz.c b/dwz.c
index f854c66..f959ffb 100644
--- a/dwz.c
+++ b/dwz.c
@@ -436,6 +436,8 @@ enum debug_section_kind
   DEBUG_ARANGES,
   DEBUG_PUBNAMES,
   DEBUG_PUBTYPES,
+  DEBUG_GNU_PUBNAMES,
+  DEBUG_GNU_PUBTYPES,
   DEBUG_MACINFO,
   DEBUG_LOC,
   DEBUG_FRAME,
@@ -467,6 +469,8 @@ static struct
     { ".debug_aranges", NULL, NULL, 0, 0, 0 },
     { ".debug_pubnames", NULL, NULL, 0, 0, 0 },
     { ".debug_pubtypes", NULL, NULL, 0, 0, 0 },
+    { ".debug_gnu_pubnames", NULL, NULL, 0, 0, 0 },
+    { ".debug_gnu_pubtypes", NULL, NULL, 0, 0, 0 },
     { ".debug_macinfo", NULL, NULL, 0, 0, 0 },
     { ".debug_loc", NULL, NULL, 0, 0, 0 },
     { ".debug_frame", NULL, NULL, 0, 0, 0 },
@@ -11755,6 +11759,10 @@ dwz (const char *file, const char *outfile, struct file_result *res,
 	  debug_sections[DEBUG_PUBNAMES].new_size = 0;
 	  debug_sections[DEBUG_PUBTYPES].new_data = NULL;
 	  debug_sections[DEBUG_PUBTYPES].new_size = 0;
+	  debug_sections[DEBUG_GNU_PUBNAMES].new_data = NULL;
+	  debug_sections[DEBUG_GNU_PUBNAMES].new_size = 0;
+	  debug_sections[DEBUG_GNU_PUBTYPES].new_data = NULL;
+	  debug_sections[DEBUG_GNU_PUBTYPES].new_size = 0;
 
 	  if (multifile && !fi_multifile && !low_mem)
 	    write_multifile (dso);
diff --git a/testsuite/dwz.tests/pr24771.sh b/testsuite/dwz.tests/pr24771.sh
new file mode 100644
index 0000000..4eb6c02
--- /dev/null
+++ b/testsuite/dwz.tests/pr24771.sh
@@ -0,0 +1,9 @@
+exec=$execs/hello-gnu-pubnames
+
+cp $exec 1
+
+dwz 1
+
+smaller-than.sh 1 $exec
+
+rm -f 1

                 reply	other threads:[~2019-07-05 14:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190705141941.GA20149@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.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).