When disassembling an application consisting of multiple modules with objdump
-S, all source code lines are read from the first source file. This problem is
caused by two missing xstrdup() calls try_print_file_open() in the file
objdump.c. It is fixed by the following patch:

diff -pu binutils-2.18.1~cvs20080103/binutils/objdump.c.orig
binutils-2.18.1~cvs20080103/binutils/objdump.c
--- binutils-2.18.1~cvs20080103/binutils/objdump.c.orig 2008-01-03
23:44:13.000000000 +0100
+++ binutils-2.18.1~cvs20080103/binutils/objdump.c      2009-01-12 
16:02:21.000000000
+0100
@@ -1062,8 +1062,8 @@ try_print_file_open (const char *orignam
   
   p->linemap = index_file (p->map, p->mapsize, &p->maxline);
   p->last_line = 0;
-  p->filename = origname;
-  p->modname = modname;
+  p->filename = xstrdup(origname);
+  p->modname = xstrdup(modname);
   p->next = print_files;
   p->first = 1;
   print_files = p;

-- 
           Summary: wrong source file shown by objdump -S
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: dick at streefland dot net
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=9735

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to