Start error message with lower case.
[deliverable/binutils-gdb.git] / gold / descriptors.cc
index 3d059e2c222ed79a02157d282d9a2d70d4ddce55..db8ad6753dea4b921a479e3b17e909e0308724ac 100644 (file)
@@ -23,6 +23,7 @@
 #include "gold.h"
 
 #include <cerrno>
+#include <cstdio>
 #include <cstring>
 #include <fcntl.h>
 #include <unistd.h>
@@ -31,6 +32,7 @@
 #include "options.h"
 #include "gold-threads.h"
 #include "descriptors.h"
+#include "binary-io.h"
 
 // Very old systems may not define FD_CLOEXEC.
 #ifndef FD_CLOEXEC
@@ -98,6 +100,9 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode)
       // require callers to pass it.
       flags |= O_CLOEXEC;
 
+      // Always open the file as a binary file.
+      flags |= O_BINARY;
+
       int new_descriptor = ::open(name, flags, mode);
       if (new_descriptor < 0
          && errno != ENFILE
@@ -108,8 +113,7 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode)
              {
                Hold_lock hl(*this->lock_);
 
-               gold_error(_("file %s was removed during the link"),
-                          this->open_descriptors_[descriptor].name);
+               gold_error(_("file %s was removed during the link"), name);
              }
 
              errno = ENOENT;
This page took 0.023403 seconds and 4 git commands to generate.