x86: correct "-Q" option handling

Message ID cff74862-c4f6-f4a9-775e-cdc9b638aa92@suse.com
State New
Headers show
Series
  • x86: correct "-Q" option handling
Related show

Commit Message

Jan Beulich July 3, 2019, 7:35 a.m.
For another patch I wanted to use a sufficiently benign option (simply
to be able to specify one, which certain test case invocations require),
and I stumbled across -Q in the --help output.  Before realizing that
this is x86-specific anyway, I've tried and and ran into a mysterious
testsuite failure, until I further realized that other than the help
text suggests the option requires an argument.  Correct the help text,
and make the implementation actually match what the comment there has
been describing (and what the help text now says).

gas/
2019-07-03  Jan Beulich  <jbeulich@suse.com>

	* config/tc-i386.c (md_parse_option): Don't blindly accept all
	-Q options.
	(md_show_usage): Correctly name the ignored -Q option flavors.

Comments

H.J. Lu July 3, 2019, 3:16 p.m. | #1
On Wed, Jul 3, 2019 at 12:37 AM Jan Beulich <JBeulich@suse.com> wrote:
>

> For another patch I wanted to use a sufficiently benign option (simply

> to be able to specify one, which certain test case invocations require),

> and I stumbled across -Q in the --help output.  Before realizing that

> this is x86-specific anyway, I've tried and and ran into a mysterious

> testsuite failure, until I further realized that other than the help

> text suggests the option requires an argument.  Correct the help text,

> and make the implementation actually match what the comment there has

> been describing (and what the help text now says).

>

> gas/

> 2019-07-03  Jan Beulich  <jbeulich@suse.com>

>

>         * config/tc-i386.c (md_parse_option): Don't blindly accept all

>         -Q options.

>         (md_show_usage): Correctly name the ignored -Q option flavors.

>

> --- a/gas/config/tc-i386.c

> +++ b/gas/config/tc-i386.c

> @@ -11141,6 +11141,8 @@ md_parse_option (int c, const char *arg)

>         /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section

>          should be emitted or not.  FIXME: Not implemented.  */

>       case 'Q':

> +      if ((arg[0] != 'y' && arg[0] != 'n') || arg[1])

> +       return 0;

>         break;

>         /* -V: SVR4 argument to print version ID.  */

> @@ -11643,7 +11645,7 @@ md_show_usage (FILE *stream)

>   {

>   #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)

>     fprintf (stream, _("\

> -  -Q                      ignored\n\

> +  -Qy, -Qn                ignored\n\

>     -V                      print assembler version number\n\

>     -k                      ignored\n"));

>   #endif


OK.

Thanks.


-- 
H.J.

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -11141,6 +11141,8 @@  md_parse_option (int c, const char *arg)
        /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section
  	 should be emitted or not.  FIXME: Not implemented.  */
      case 'Q':
+      if ((arg[0] != 'y' && arg[0] != 'n') || arg[1])
+	return 0;
        break;
  
        /* -V: SVR4 argument to print version ID.  */
@@ -11643,7 +11645,7 @@  md_show_usage (FILE *stream)
  {
  #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
    fprintf (stream, _("\
-  -Q                      ignored\n\
+  -Qy, -Qn                ignored\n\
    -V                      print assembler version number\n\
    -k                      ignored\n"));
  #endif