aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-07-17 10:51:45 +0100
committerNick Clifton <nickc@redhat.com>2017-07-17 10:51:45 +0100
commit2a925816fc3848f1d48c4783df3dd54116907a57 (patch)
treeef5940d16e9a0deb5ded3166b809af2e215f60c5 /binutils
parentf27dadca0ad18d5a0ba032c3d3f6a60ea55d887b (diff)
downloadfsf-binutils-gdb-2a925816fc3848f1d48c4783df3dd54116907a57.zip
fsf-binutils-gdb-2a925816fc3848f1d48c4783df3dd54116907a57.tar.gz
fsf-binutils-gdb-2a925816fc3848f1d48c4783df3dd54116907a57.tar.bz2
Correct previous fix for an absence of input files on the ar command line, so that a complaint is not issued in MRI mode.
PR 21433 * ar.c (main): Skip check for no files on the command line when running in MRI mode.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/ar.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 19de4a0..f1400dc 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-17 Nick Clifton <nickc@redhat.com>
+
+ PR 21433
+ * ar.c (main): Skip check for no files on the command line when
+ running in MRI mode.
+
2017-07-13 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/binutils-all/objdump.exp: Always delete $testarchive
diff --git a/binutils/ar.c b/binutils/ar.c
index ef8b5bd..25f3b3d 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -738,9 +738,6 @@ main (int argc, char **argv)
arg_index = 0;
- if (argv[arg_index] == NULL)
- usage (0);
-
if (mri_mode)
{
default_deterministic ();
@@ -750,6 +747,12 @@ main (int argc, char **argv)
{
bfd *arch;
+ /* Fail if no files are specified on the command line.
+ (But not for MRI mode which allows for reading arguments
+ and filenames from stdin). */
+ if (argv[arg_index] == NULL)
+ usage (0);
+
/* We don't use do_quick_append any more. Too many systems
expect ar to always rebuild the symbol table even when q is
used. */