aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-10-10 04:56:43 +0000
committerIan Lance Taylor <ian@airs.com>2009-10-10 04:56:43 +0000
commitf3048a1d4770f01625461c6d967a774f5a3f8496 (patch)
treeeca9d1b7a91be25e92e33bd76ac88c277aab933e /gold
parentec2d9b29273a260dad374eca5bbe2f7922d0bfde (diff)
downloadgdb-f3048a1d4770f01625461c6d967a774f5a3f8496.zip
gdb-f3048a1d4770f01625461c6d967a774f5a3f8496.tar.gz
gdb-f3048a1d4770f01625461c6d967a774f5a3f8496.tar.bz2
* 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.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/descriptors.cc5
-rw-r--r--gold/script.cc2
3 files changed, 13 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 0ae3429..74f72b8 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,10 @@
+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.
diff --git a/gold/descriptors.cc b/gold/descriptors.cc
index 3d059e2..f4a02d0 100644
--- a/gold/descriptors.cc
+++ b/gold/descriptors.cc
@@ -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
diff --git a/gold/script.cc b/gold/script.cc
index 05a39e7..d381f55 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -743,7 +743,7 @@ Lex::get_token(const char** pp)
}
// Skip whitespace quickly.
- while (*p == ' ' || *p == '\t')
+ while (*p == ' ' || *p == '\t' || *p == '\r')
++p;
if (*p == '\n')