This is the mail archive of the
mailing list for the binutils project.
[patch] PR 12983: Fix nm to decompress debug sections when printing line numbers
- From: Cary Coutant <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Mon, 11 Jul 2011 17:01:37 -0700
- Subject: [patch] PR 12983: Fix nm to decompress debug sections when printing line numbers
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.)
2011-07-11 Cary Coutant <email@example.com>
* 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
@@ -1202,6 +1202,10 @@ display_file (char *filename)
+ /* If printing line numbers, decompress the debug sections. */
+ if (line_numbers)
+ file->flags |= BFD_DECOMPRESS;
if (bfd_check_format (file, bfd_archive))