summaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2009-06-27 17:19:02 +0000
committerH.J. Lu <hjl@lucon.org>2009-06-27 17:19:02 +0000
commitae371689a784ec78f75061e918c5719c6ba0f0a9 (patch)
tree453c52e90e2a9b13a0098f6bd4ef8d013fa73014 /binutils/objcopy.c
parentb23a571b57078faa996fdbc88ab6dd2d69b28135 (diff)
downloadbinutils-redhat-ae371689a784ec78f75061e918c5719c6ba0f0a9.tar.gz
2009-06-27 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/10321 * bucomm.c (get_file_size): Return -1 on error. * objcopy.c (copy_file): Report empty file.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 83d9e1b2aa..8908b564e1 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -2159,9 +2159,13 @@ copy_file (const char *input_filename, const char *output_filename,
bfd *ibfd;
char **obj_matching;
char **core_matching;
+ off_t size = get_file_size (input_filename);
- if (get_file_size (input_filename) < 1)
+ if (size < 1)
{
+ if (size == 0)
+ non_fatal (_("error: the input file '%s' is empty"),
+ input_filename);
status = 1;
return;
}