[Top][All Lists]

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

[Bug binutils/6449] New: objdump -S and DOS-style line-endings

From: mthomas at rhrk dot uni-kl dot de
Subject: [Bug binutils/6449] New: objdump -S and DOS-style line-endings
Date: 23 Apr 2008 16:47:11 -0000

When using objdump to create intermixed source/disassembly (-S) with build/host
mingw/minsys a size-check fails for source-files with DOS-line endings (\r\n)
since this gets translated "internally" to a single char. When opening the file
in binary mode the sizes match. Proposed fix/patch:

--- binutils-2.18.50_org/binutils/objdump.c     Sat Mar  1 07:19:06 2008
+++ binutils-2.18.50/binutils/objdump.c Thu Mar 13 12:29:47 2008
@@ -70,6 +70,14 @@
 #include <sys/stat.h>
+#ifndef O_BINARY
+#ifdef _O_BINARY
+#define O_BINARY 0
 /* Internal headers for the ELF .stab-dump code - sorry.  */
 #define        BYTES_IN_WORD   32
 #include "aout/aout64.h"
@@ -975,7 +983,7 @@
   const char *map;
   struct stat st;
-  int fd = open (fn, O_RDONLY);
+  int fd = open (fn, O_RDONLY | O_BINARY);
   if (fd < 0)
     return NULL;

           Summary: objdump -S and DOS-style line-endings
           Product: binutils
           Version: 2.19 (HEAD)
            Status: NEW
          Severity: minor
          Priority: P3
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: mthomas at rhrk dot uni-kl dot de
                CC: bug-binutils at gnu dot org


------- 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]