public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Cary Coutant <ccoutant@google.com>
To: Binutils <binutils@sourceware.org>, "H.J. Lu" <hjl.tools@gmail.com>
Subject: [patch] PR 12983: Fix nm to decompress debug sections when printing line numbers
Date: Tue, 12 Jul 2011 09:43:00 -0000	[thread overview]
Message-ID: <CAHACq4oMDYA+UokUcnwswF45dyhKX0ce3z25LDiHEL7qjrB11w@mail.gmail.com> (raw)

The nm tool doesn't currently request BFD to decompress input
sections, so when it tries to print line numbers we get an internal
error. This patch fixes that.

Is this OK for trunk? (I'd have called it obvious, but I wasn't sure
about the placement of the code to set the flag. The flag seems to
propagate to archive members, so it didn't seem necessary to set the
flag explicitly for each archive member.)

-cary


2011-07-11  Cary Coutant  <ccoutant@google.com>

	PR 12983
	* binutils/nm.c (display_file): Decompress debug sections when
	printing line numbers.


diff --git a/binutils/nm.c b/binutils/nm.c
index 2fc13b4..04067b1 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -1202,6 +1202,10 @@ display_file (char *filename)
       return FALSE;
     }

+  /* If printing line numbers, decompress the debug sections.  */
+  if (line_numbers)
+    file->flags |= BFD_DECOMPRESS;
+
   if (bfd_check_format (file, bfd_archive))
     {
       display_archive (file);

             reply	other threads:[~2011-07-12  0:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12  9:43 Cary Coutant [this message]
2011-07-12 15:17 ` Alan Modra

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=CAHACq4oMDYA+UokUcnwswF45dyhKX0ce3z25LDiHEL7qjrB11w@mail.gmail.com \
    --to=ccoutant@google.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.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).