aboutsummaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-04-28 08:30:23 +0000
committerNick Clifton <nickc@redhat.com>2008-04-28 08:30:23 +0000
commit417ed8af836c10ff5c0cbcdc4c011f5024a7269b (patch)
treee8226b5010a9af926802fd3a80993c68c852c791 /binutils/objdump.c
parent03ffc2d0a62908f72e010495ebd7f5a7efe08e3f (diff)
downloadgdb-417ed8af836c10ff5c0cbcdc4c011f5024a7269b.zip
gdb-417ed8af836c10ff5c0cbcdc4c011f5024a7269b.tar.gz
gdb-417ed8af836c10ff5c0cbcdc4c011f5024a7269b.tar.bz2
PR binutils/6449
* objdump.c (slurp_file): Open the file in binary mode. * ar.c: Remove conditional definition of O_BINARY. * bin2.c: Likewise. * rename.c: Likewise. * strings.c: Likewise. * sysdep.h: Add conditional definition of O_BINARY.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index b348025..5a86250 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -964,7 +964,7 @@ static struct print_file_list *print_files;
#define SHOW_PRECEDING_CONTEXT_LINES (5)
-/* Read a complete file into memory. */
+/* Read a complete file into memory. */
static const char *
slurp_file (const char *fn, size_t *size)
@@ -975,7 +975,7 @@ slurp_file (const char *fn, size_t *size)
#endif
const char *map;
struct stat st;
- int fd = open (fn, O_RDONLY);
+ int fd = open (fn, O_RDONLY | O_BINARY);
if (fd < 0)
return NULL;