bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/29623] New: The help document of as misses so many options


From: mengda2020 at iscas dot ac.cn
Subject: [Bug gas/29623] New: The help document of as misses so many options
Date: Wed, 28 Sep 2022 02:49:57 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29623

            Bug ID: 29623
           Summary: The help document of as misses so many options
           Product: binutils
           Version: 2.39
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: mengda2020 at iscas dot ac.cn
  Target Milestone: ---

The "--help" option of as misses the option "al", "dump-config", "emulation",
"gdwarf-cie-version", "hash-size", "itbl", "reduce-memory-overheads",
"multibyte-handling", "mbig-obj", "O". 

1) For the option "al", the following code appears during option parsing and
modifies the listing and listing_filename in gas/as.c:1017-1021 for version
2.39.

        case OPTION_AL:
          listing |= LISTING_LISTING;
          if (optarg)
            listing_filename = xstrdup (optarg);
          break;

2) For the option "dump-config", the following code appears during option
parsing and prints some supplementary information in gas/as.c:728-738 for
version 2.39. 

        case OPTION_DUMPCONFIG:
          fprintf (stderr, _("alias = %s\n"), TARGET_ALIAS);
          fprintf (stderr, _("canonical = %s\n"), TARGET_CANONICAL);
          fprintf (stderr, _("cpu-type = %s\n"), TARGET_CPU);
#ifdef TARGET_OBJ_FORMAT
          fprintf (stderr, _("format = %s\n"), TARGET_OBJ_FORMAT);
#endif
#ifdef TARGET_FORMAT
          fprintf (stderr, _("bfd-target = %s\n"), TARGET_FORMAT);
#endif
          exit (EXIT_SUCCESS);

3) For the option "emulation", the following code appears during option parsing
and may print some error information in gas/as.c:719-726 for version 2.39.

        case OPTION_EMULATION:
#ifdef USE_EMULATIONS
          if (strcmp (optarg, this_emulation->name))
            as_fatal (_("multiple emulation names specified"));
#else
          as_fatal (_("emulations not handled in this configuration"));
#endif
          break;

4) For the option "gdwarf-cie-version", the following code appears during
option parsing and prints some error information and modifies the
flag_dwarf_cie_version and dwarf_level in gas/as.c:884-907 for version 2.39.

        case OPTION_GDWARF_CIE_VERSION:
          flag_dwarf_cie_version = atoi (optarg);
          /* The available CIE versions are 1 (DWARF 2), 3 (DWARF 3), and 4
             (DWARF 4 and 5).  */
          if (flag_dwarf_cie_version < 1
              || flag_dwarf_cie_version == 2
              || flag_dwarf_cie_version > 4)
            as_fatal (_("Invalid --gdwarf-cie-version `%s'"), optarg);
          switch (flag_dwarf_cie_version)
            {
            case 1:
              if (dwarf_level < 2)
                dwarf_level = 2;
              break;
            case 3:
              if (dwarf_level < 3)
                dwarf_level = 3;
              break;
            default:
              if (dwarf_level < 4)
                dwarf_level = 4;
              break;
            }
          break;

5) For the option "hash-size", the following code appears during option parsing
in gas/as.c:1120-1121 for version 2.39.

        case OPTION_HASH_TABLE_SIZE:
          break;

Although it has no actual function, it is still possible forget to modify the
help document after adding the function in a subsequent update.

6) For the option "itbl", the following code appears during option parsing and
may modify the itbl_files in gas/as.c:792-820 for version 2.39.

#ifdef HAVE_ITBL_CPU
        case 't':
          {
            /* optarg is the name of the file containing the instruction
               formats, opcodes, register names, etc.  */
            struct itbl_file_list *n;

            if (optarg == NULL)
              {
                as_warn (_("no file name following -t option"));
                break;
              }

            n = XNEW (struct itbl_file_list);
            n->next = itbl_files;
            n->name = optarg;
            itbl_files = n;

            /* Parse the file and add the new instructions to our internal
               table.  If multiple instruction tables are specified, the
               information from this table gets appended onto the existing
               internal table.  */
            itbl_files->name = xstrdup (optarg);
            if (itbl_parse (itbl_files->name) != 0)
              as_fatal (_("failed to read instruction table %s\n"),
                        itbl_files->name);
          }
          break;
#endif

7) For the option "reduce-memory-overheads", the following code appears during
option parsing in gas/as.c:1117-1118 for version 2.39.

        case OPTION_REDUCE_MEMORY_OVERHEADS:
          break;

Although it has no actual function, it is still possible forget to modify the
help document after adding the function in a subsequent update.

8) For the option "multibyte-handling", the following code appears during
option parsing and modifies the multibyte_handling in gas/as.c:688-699 for
version 2.39.

        case OPTION_MULTIBYTE_HANDLING:
          if (strcmp (optarg, "allow") == 0)
            multibyte_handling = multibyte_allow;
          else if (strcmp (optarg, "warn") == 0)
            multibyte_handling = multibyte_warn;
          else if (strcmp (optarg, "warn-sym-only") == 0)
            multibyte_handling = multibyte_warn_syms;
          else if (strcmp (optarg, "warn_sym_only") == 0)
            multibyte_handling = multibyte_warn_syms;
          else
            as_fatal (_("unexpected argument to --multibyte-input-option:
'%s'"), optarg);
          break;

9) For the option "mbig-obj", the following code appears during option parsing
and may modify the use_big_obj in gas/config/tc-i386.c:13505-13508 for version
2.39.

# if defined (TE_PE) || defined (TE_PEP)
    case OPTION_MBIG_OBJ:
      use_big_obj = 1;
      break;
#endif

10) For the option "O", the following code appears during option parsing and
modifies the optimize and optiomize_for_space in
gas/config/tc-i386.c:13669-13687 for version 2.39.

      if (arg == NULL)
        {
          optimize = 1;
          /* Turn off -Os.  */
          optimize_for_space = 0;
        }
      else if (*arg == 's')
        {
          optimize_for_space = 1;
          /* Turn on all encoding optimizations.  */
          optimize = INT_MAX;
        }
      else
        {
          optimize = atoi (arg);
          /* Turn off -Os.  */
          optimize_for_space = 0;
        }
      break;

But they do not appear in the document provided by "help".

It may prevent users from using the relevant function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]