[PATCH GOLD] [5/N mingw host] open files in binary mode
Ian Lance Taylor
iant@google.com
Sat Oct 10 04:58:00 GMT 2009
Andrew Pinski <Andrew_Pinski@playstation.sony.com> writes:
> Under mingw, files are opened by default in text mode which means
> /n/r is converted into /n but since we are reading in binary files,
> this confuses the rest of the linker.
>
> OK? Built and tested on i686-linux-gnu.
>
> Thanks,
> Andrew Pinski
>
> ChangeLog:
>
> * descriptor.c: Include binary-io.h.
> (Descriptors::open): Open the files in binary mode always.
This could cause linker scripts to see \r. Also binary-io.h says to
be sure to include <stdio.h> first. I committed the patch as follows.
Thanks.
Ian
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 1326 bytes
Desc: binary
URL: <https://sourceware.org/pipermail/binutils/attachments/20091010/bb48ddfc/attachment.bin>
More information about the Binutils
mailing list