(Descriptors::open): Open the files in binary mode always.
* script.cc (Lex::get_token): Treat \r as whitespace.
+2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
+ Ian Lance Taylor <iant@google.com>
+
+ * descriptor.cc: Include <cstdio> and "binary-io.h".
+ (Descriptors::open): Open the files in binary mode always.
+ * script.cc (Lex::get_token): Treat \r as whitespace.
+
2009-10-09 Ian Lance Taylor <iant@google.com>
* testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
#include "gold.h"
#include <cerrno>
+#include <cstdio>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#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
// 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
}
// Skip whitespace quickly.
- while (*p == ' ' || *p == '\t')
+ while (*p == ' ' || *p == '\t' || *p == '\r')
++p;
if (*p == '\n')