public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] PR 12983: Fix nm to decompress debug sections when printing line numbers
@ 2011-07-12  9:43 Cary Coutant
  2011-07-12 15:17 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Cary Coutant @ 2011-07-12  9:43 UTC (permalink / raw)
  To: Binutils, H.J. Lu

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

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

* Re: [patch] PR 12983: Fix nm to decompress debug sections when printing line numbers
  2011-07-12  9:43 [patch] PR 12983: Fix nm to decompress debug sections when printing line numbers Cary Coutant
@ 2011-07-12 15:17 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2011-07-12 15:17 UTC (permalink / raw)
  To: Cary Coutant; +Cc: Binutils, H.J. Lu

On Mon, Jul 11, 2011 at 05:01:37PM -0700, Cary Coutant wrote:
> 	PR 12983
> 	* binutils/nm.c (display_file): Decompress debug sections when
> 	printing line numbers.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

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

end of thread, other threads:[~2011-07-12  0:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12  9:43 [patch] PR 12983: Fix nm to decompress debug sections when printing line numbers Cary Coutant
2011-07-12 15:17 ` Alan Modra

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