diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-06-27 17:19:02 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-06-27 17:19:02 +0000 |
commit | 52a476eeda8cf7a753a58991293cae95baa44797 (patch) | |
tree | 74e5067886a9b0aaf9e2b60c04933951a0a95492 /binutils/objcopy.c | |
parent | 83b89087cf717b455598eee2fb5ddb4d5465a6a0 (diff) | |
download | gdb-52a476eeda8cf7a753a58991293cae95baa44797.zip gdb-52a476eeda8cf7a753a58991293cae95baa44797.tar.gz gdb-52a476eeda8cf7a753a58991293cae95baa44797.tar.bz2 |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 83d9e1b..8908b56 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; } |