Fix compile time warning: bfd/elf32-arc.c:1537]: (warning) Redundant assignment of...
[deliverable/binutils-gdb.git] / ld / lexsup.c
index 6d28e9142b090814dd9dd0637e4a44da5732a91a..f2191602d41bb18932585d9ec07ed2025c8e9de7 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse options for the GNU linker.
-   Copyright (C) 1991-2016 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -112,6 +112,9 @@ static const struct ld_option ld_options[] =
     'd', NULL, N_("Force common symbols to be defined"), ONE_DASH },
   { {"dp", no_argument, NULL, 'd'},
     '\0', NULL, NULL, ONE_DASH },
+  { {"force-group-allocation", no_argument, NULL,
+     OPTION_FORCE_GROUP_ALLOCATION},
+    '\0', NULL, N_("Force group members out of groups"), TWO_DASHES },
   { {"entry", required_argument, NULL, 'e'},
     'e', N_("ADDRESS"), N_("Set start address"), TWO_DASHES },
   { {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
@@ -164,6 +167,8 @@ static const struct ld_option ld_options[] =
     'o', N_("FILE"), N_("Set output file name"), EXACTLY_TWO_DASHES },
   { {NULL, required_argument, NULL, '\0'},
     'O', NULL, N_("Optimize output file"), ONE_DASH },
+  { {"out-implib", required_argument, NULL, OPTION_OUT_IMPLIB},
+    '\0', N_("FILE"), N_("Generate import library"), TWO_DASHES },
 #ifdef ENABLE_PLUGINS
   { {"plugin", required_argument, NULL, OPTION_PLUGIN},
     '\0', N_("PLUGIN"), N_("Load named plugin"), ONE_DASH },
@@ -333,6 +338,9 @@ static const struct ld_option ld_options[] =
   { {"no-print-gc-sections", no_argument, NULL, OPTION_NO_PRINT_GC_SECTIONS},
     '\0', NULL, N_("Do not list removed unused sections"),
     TWO_DASHES },
+  { {"gc-keep-exported", no_argument, NULL, OPTION_GC_KEEP_EXPORTED},
+    '\0', NULL, N_("Keep exported symbols when removing unused sections"),
+    TWO_DASHES },
   { {"hash-size=<NUMBER>", required_argument, NULL, OPTION_HASH_SIZE},
     '\0', NULL, N_("Set default hash table size close to <NUMBER>"),
     TWO_DASHES },
@@ -705,6 +713,7 @@ parse_args (unsigned argc, char **argv)
 
        default:
          einfo (_("%P%F: use the --help option for usage information\n"));
+         break;
 
        case 1:                 /* File name.  */
          lang_add_input_file (optarg, lang_input_file_is_file_enum, NULL);
@@ -761,6 +770,9 @@ parse_args (unsigned argc, char **argv)
        case 'd':
          command_line.force_common_definition = TRUE;
          break;
+       case OPTION_FORCE_GROUP_ALLOCATION:
+         command_line.force_group_allocation = TRUE;
+         break;
        case OPTION_DEFSYM:
          lex_string = optarg;
          lex_redirect (optarg, "--defsym", ++defsym_count);
@@ -816,7 +828,7 @@ parse_args (unsigned argc, char **argv)
          if (command_line.auxiliary_filters == NULL)
            {
              command_line.auxiliary_filters = (char **)
-                  xmalloc (2 * sizeof (char *));
+               xmalloc (2 * sizeof (char *));
              command_line.auxiliary_filters[0] = optarg;
              command_line.auxiliary_filters[1] = NULL;
            }
@@ -829,8 +841,8 @@ parse_args (unsigned argc, char **argv)
              for (p = command_line.auxiliary_filters; *p != NULL; p++)
                ++c;
              command_line.auxiliary_filters = (char **)
-                  xrealloc (command_line.auxiliary_filters,
-                           (c + 2) * sizeof (char *));
+               xrealloc (command_line.auxiliary_filters,
+                         (c + 2) * sizeof (char *));
              command_line.auxiliary_filters[c] = optarg;
              command_line.auxiliary_filters[c + 1] = NULL;
            }
@@ -858,6 +870,9 @@ parse_args (unsigned argc, char **argv)
        case OPTION_PRINT_GC_SECTIONS:
          link_info.print_gc_sections = TRUE;
          break;
+       case OPTION_GC_KEEP_EXPORTED:
+         link_info.gc_keep_exported = TRUE;
+         break;
        case OPTION_HELP:
          help ();
          xexit (0);
@@ -893,7 +908,7 @@ parse_args (unsigned argc, char **argv)
          input_flags.dynamic = FALSE;
          break;
        case OPTION_NO_DEFINE_COMMON:
-         command_line.inhibit_common_definition = TRUE;
+         link_info.inhibit_common_definition = TRUE;
          break;
        case OPTION_NO_DEMANGLE:
          demangling = FALSE;
@@ -937,7 +952,7 @@ parse_args (unsigned argc, char **argv)
              link_info.unresolved_syms_in_shared_libs
                = how_to_report_unresolved_symbols;
            }
-         else if (strcmp (optarg, "ignore-in-shared-libs") == 0)
+         else if (strcmp (optarg, "ignore-in-shared-libs") == 0)
            {
              link_info.unresolved_syms_in_objects
                = how_to_report_unresolved_symbols;
@@ -1004,6 +1019,9 @@ parse_args (unsigned argc, char **argv)
        case OPTION_OFORMAT:
          lang_add_output_format (optarg, NULL, NULL, 0);
          break;
+       case OPTION_OUT_IMPLIB:
+         command_line.out_implib_filename = xstrdup (optarg);
+         break;
        case OPTION_PRINT_SYSROOT:
          if (*ld_sysroot)
            puts (ld_sysroot);
@@ -1112,8 +1130,8 @@ parse_args (unsigned argc, char **argv)
              char *buf;
 
              buf = (char *) xmalloc (strlen (command_line.rpath_link)
-                                      + strlen (optarg)
-                                      + 2);
+                                     + strlen (optarg)
+                                     + 2);
              sprintf (buf, "%s%c%s", command_line.rpath_link,
                       config.rpath_separator, optarg);
              free (command_line.rpath_link);
@@ -1180,8 +1198,8 @@ parse_args (unsigned argc, char **argv)
        case OPTION_SORT_COMMON:
          if (optarg == NULL
              || strcmp (optarg, N_("descending")) == 0)
-            config.sort_common = sort_descending;
-          else if (strcmp (optarg, N_("ascending")) == 0)
+           config.sort_common = sort_descending;
+         else if (strcmp (optarg, N_("ascending")) == 0)
            config.sort_common = sort_ascending;
          else
            einfo (_("%P%F: invalid common section sorting option: %s\n"),
@@ -1275,7 +1293,7 @@ parse_args (unsigned argc, char **argv)
          break;
        case OPTION_TASK_LINK:
          link_info.task_link = TRUE;
-         /* Fall through - do an implied -r option.  */
+         /* Fall through.  */
        case OPTION_UR:
          if (bfd_link_pic (&link_info))
            einfo (_("%P%F: -r and %s may not be used together\n"),
@@ -1290,8 +1308,8 @@ parse_args (unsigned argc, char **argv)
        case 'u':
          ldlang_add_undef (optarg, TRUE);
          break;
-        case OPTION_REQUIRE_DEFINED_SYMBOL:
-          ldlang_add_require_defined (optarg);
+       case OPTION_REQUIRE_DEFINED_SYMBOL:
+         ldlang_add_require_defined (optarg);
          break;
        case OPTION_UNIQUE:
          if (optarg != NULL)
@@ -1504,17 +1522,17 @@ parse_args (unsigned argc, char **argv)
            config.hash_table_size = 1021;
          break;
 
-        case OPTION_HASH_SIZE:
+       case OPTION_HASH_SIZE:
          {
            bfd_size_type new_size;
 
-            new_size = strtoul (optarg, NULL, 0);
-            if (new_size)
-              config.hash_table_size = new_size;
-            else
-              einfo (_("%P%X: --hash-size needs a numeric argument\n"));
-          }
-          break;
+           new_size = strtoul (optarg, NULL, 0);
+           if (new_size)
+             config.hash_table_size = new_size;
+           else
+             einfo (_("%P%X: --hash-size needs a numeric argument\n"));
+         }
+         break;
 
        case OPTION_PUSH_STATE:
          input_flags.pushed = xmemdup (&input_flags,
@@ -1614,6 +1632,7 @@ parse_args (unsigned argc, char **argv)
       break;
     case dynamic_list_data:
       link_info.dynamic_data = TRUE;
+      /* Fall through.  */
     case dynamic_list:
       link_info.dynamic = TRUE;
       break;
@@ -1719,6 +1738,8 @@ elf_shlib_list_options (FILE *file)
   fprintf (file, _("\
   --eh-frame-hdr              Create .eh_frame_hdr section\n"));
   fprintf (file, _("\
+  --no-eh-frame-hdr           Do not create .eh_frame_hdr section\n"));
+  fprintf (file, _("\
   --exclude-libs=LIBS         Make all symbols in LIBS hidden\n"));
   fprintf (file, _("\
   --hash-style=STYLE          Set hash style to sysv, gnu or both\n"));
@@ -1766,12 +1787,16 @@ elf_shlib_list_options (FILE *file)
   fprintf (file, _("\
   -z norelro                  Don't create RELRO program header (default)\n"));
 #endif
+  fprintf (file, _("\
+  -z separate-code            Create separate code program header\n"));
+  fprintf (file, _("\
+  -z noseparate-code          Don't create separate code program header (default)\n"));
   fprintf (file, _("\
   -z common                   Generate common symbols with STT_COMMON type\n"));
   fprintf (file, _("\
   -z nocommon                 Generate common symbols with STT_OBJECT type\n"));
   fprintf (file, _("\
-  -z stacksize=SIZE           Set size of stack segment\n"));
+  -z stack-size=SIZE          Set size of stack segment\n"));
   fprintf (file, _("\
   -z text                     Treat DT_TEXTREL in shared object as error\n"));
   fprintf (file, _("\
@@ -1807,6 +1832,8 @@ elf_static_list_options (FILE *file)
   -z execstack                Mark executable as requiring executable stack\n"));
   fprintf (file, _("\
   -z noexecstack              Mark executable as not requiring executable stack\n"));
+  fprintf (file, _("\
+  -z globalaudit              Mark executable requiring global auditing\n"));
 }
 
 static void
This page took 0.044117 seconds and 4 git commands to generate.