* 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.
This commit is contained in:
Ian Lance Taylor 2009-10-10 04:56:43 +00:00
parent ec2d9b2927
commit f3048a1d47
3 changed files with 13 additions and 1 deletions

View File

@ -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.

View 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

View File

@ -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')