Introduce and use make_unique_xstrdup
[deliverable/binutils-gdb.git] / ld / lexsup.c
index 636ce17bab1377bc8f1e2384c8a34278a782054b..2539356baa7b930d9eb19cd52cd4fa0ca7010327 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse options for the GNU linker.
-   Copyright (C) 1991-2018 Free Software Foundation, Inc.
+   Copyright (C) 1991-2019 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -314,6 +314,11 @@ static const struct ld_option ld_options[] =
   { {"demangle", optional_argument, NULL, OPTION_DEMANGLE},
     '\0', N_("[=STYLE]"), N_("Demangle symbol names [using STYLE]"),
     TWO_DASHES },
+  { {"disable-multiple-abs-defs", no_argument, NULL,
+     OPTION_DISABLE_MULTIPLE_DEFS_ABS},
+    '\0', NULL, N_("Do not allow multiple definitions with symbols included\n"
+                  "           in filename invoked by -R or --just-symbols"),
+    TWO_DASHES},
   { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
     '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES},
   { {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL},
@@ -538,6 +543,12 @@ static const struct ld_option ld_options[] =
   { {"orphan-handling", required_argument, NULL, OPTION_ORPHAN_HANDLING},
     '\0', N_("=MODE"), N_("Control how orphan sections are handled."),
     TWO_DASHES },
+  { {"print-map-discarded", no_argument, NULL, OPTION_PRINT_MAP_DISCARDED},
+    '\0', NULL, N_("Show discarded sections in map file output (default)"),
+    TWO_DASHES },
+  { {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED},
+    '\0', NULL, N_("Do not show discarded sections in map file output"),
+    TWO_DASHES },
 };
 
 #define OPTION_COUNT ARRAY_SIZE (ld_options)
@@ -1159,6 +1170,9 @@ parse_args (unsigned argc, char **argv)
        case OPTION_NO_STRIP_DISCARDED:
          link_info.strip_discarded = FALSE;
          break;
+       case OPTION_DISABLE_MULTIPLE_DEFS_ABS:
+         link_info.prohibit_multiple_definition_absolute = TRUE;
+         break;
        case OPTION_SHARED:
          if (config.has_shared)
            {
@@ -1225,11 +1239,11 @@ parse_args (unsigned argc, char **argv)
          command_line.symbolic = symbolic_functions;
          break;
        case 't':
-         trace_files = TRUE;
+         ++trace_files;
          break;
        case 'T':
          previous_script_handle = saved_script_handle;
-         ldfile_open_command_file (optarg);
+         ldfile_open_script_file (optarg);
          parser_input = input_script;
          yyparse ();
          previous_script_handle = NULL;
@@ -1569,6 +1583,14 @@ parse_args (unsigned argc, char **argv)
            einfo (_("%F%P: invalid argument to option"
                     " \"--orphan-handling\"\n"));
          break;
+
+       case OPTION_NO_PRINT_MAP_DISCARDED:
+         config.print_map_discarded = FALSE;
+         break;
+
+       case OPTION_PRINT_MAP_DISCARDED:
+         config.print_map_discarded = TRUE;
+         break;
        }
     }
 
@@ -1788,10 +1810,17 @@ elf_shlib_list_options (FILE *file)
   fprintf (file, _("\
   -z norelro                  Don't create RELRO program header (default)\n"));
 #endif
+#if DEFAULT_LD_Z_SEPARATE_CODE
+  fprintf (file, _("\
+  -z separate-code            Create separate code program header (default)\n"));
+  fprintf (file, _("\
+  -z noseparate-code          Don't create separate code program header\n"));
+#else
   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"));
+#endif
   fprintf (file, _("\
   -z common                   Generate common symbols with STT_COMMON type\n"));
   fprintf (file, _("\
This page took 0.026154 seconds and 4 git commands to generate.