aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-10-09 00:11:28 +1030
committerAlan Modra <amodra@gmail.com>2019-10-09 00:20:28 +1030
commitb7d9d3ee59236d6039d7d7ccd17ff6b47e07a8aa (patch)
tree5f11448ea6ff9f6b9d4bccf2a81b56be28555710 /binutils
parentPR25078, stack overflow in function find_abstract_instance (diff)
downloadbinutils-gdb-b7d9d3ee59236d6039d7d7ccd17ff6b47e07a8aa.tar.gz
binutils-gdb-b7d9d3ee59236d6039d7d7ccd17ff6b47e07a8aa.tar.bz2
binutils-gdb-b7d9d3ee59236d6039d7d7ccd17ff6b47e07a8aa.zip
PR25079, "ar s" stopped working
's' is both a command and a modifier. If given as a command then we aren't lacking an operation. I think the same goes when mri mode is selected: any following command line used to be ignored. PR 25079 * ar.c (decode_options): Don't try for command options if write_armap or mri_mode is selected.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/ar.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b9e2fcf1a46..1761d80ef5f 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2019-10-09 Alan Modra <amodra@gmail.com>
+
+ PR 25079
+ * ar.c (decode_options): Don't try for command options if
+ write_armap or mri_mode is selected.
+
2019-10-07 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* readelf.c (display_msp430_gnu_attribute): New.
diff --git a/binutils/ar.c b/binutils/ar.c
index 6bac862bc73..b99afff1c7e 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -602,7 +602,8 @@ decode_options (int argc, char **argv)
/* PR 13256: Allow for the possibility that the first command line option
started with a dash (eg --plugin) but then the following option(s) are
old style, non-dash-prefixed versions. */
- if (operation == none && optind > 0 && optind < argc)
+ if (operation == none && write_armap != 1 && !mri_mode
+ && optind > 0 && optind < argc)
{
argv += (optind - 1);
argc -= (optind - 1);