bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/630] New: patch included, nlmconv writes invalid nlm name


From: diehl at nordrhein dot de
Subject: [Bug binutils/630] New: patch included, nlmconv writes invalid nlm name in header
Date: 1 Jan 2005 18:53:01 -0000

in case the output file name is with path, nlmconv writes the path instead of
only the nlm name into the header. Here a patch for binutils/nlmconv.c to fix 
that:

--- nlmconv.c.org       2004-01-14 22:07:44.000000000 +0100
+++ nlmconv.c   2005-01-01 19:41:45.233546002 +0100
@@ -1057,12 +1057,16 @@
        sharedhdr.exitProcedureOffset;
       free (data);
     }
-  len = strlen (output_file);
+
+  char *p = output_file + strlen (output_file) - 1;
+  while ((p > output_file) && (*p != '/')) p--;
+  if (*p == '/') p++;
+  len = strlen (p);
   if (len > NLM_MODULE_NAME_SIZE - 2)
     len = NLM_MODULE_NAME_SIZE - 2;
   nlm_fixed_header (outbfd)->moduleName[0] = len;

-  strncpy (nlm_fixed_header (outbfd)->moduleName + 1, output_file,
+  strncpy (nlm_fixed_header (outbfd)->moduleName + 1, p,
           NLM_MODULE_NAME_SIZE - 2);
   nlm_fixed_header (outbfd)->moduleName[NLM_MODULE_NAME_SIZE - 1] = '\0';
   for (modname = nlm_fixed_header (outbfd)->moduleName;

-- 
           Summary: patch included, nlmconv writes invalid nlm name in
                    header
           Product: binutils
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: diehl at nordrhein dot de
                CC: bug-binutils at gnu dot org
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-pc-netware


http://sources.redhat.com/bugzilla/show_bug.cgi?id=630

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]