elf/x86: Issue an error on discarded output .plt section
[binutils-gdb.git] / ld / lexsup.c
index 00274c500d0019cdf4f39b22e5e701d8b7a58bd6..c128fe3a96be67ee8587d0a92449d9f93f2d94d7 100644 (file)
@@ -433,6 +433,10 @@ static const struct ld_option ld_options[] =
      OPTION_REDUCE_MEMORY_OVERHEADS},
     '\0', NULL, N_("Reduce memory overheads, possibly taking much longer"),
     TWO_DASHES },
+  { {"max-cache-size=SIZE", required_argument, NULL,
+    OPTION_MAX_CACHE_SIZE},
+    '\0', NULL, N_("Set the maximum cache size to SIZE bytes"),
+    TWO_DASHES },
   { {"relax", no_argument, NULL, OPTION_RELAX},
     '\0', NULL, N_("Reduce code size by using target specific optimizations"), TWO_DASHES },
   { {"no-relax", no_argument, NULL, OPTION_NO_RELAX},
@@ -1631,6 +1635,17 @@ parse_args (unsigned argc, char **argv)
            config.hash_table_size = 1021;
          break;
 
+       case OPTION_MAX_CACHE_SIZE:
+         {
+           char *end;
+           bfd_size_type cache_size = strtoul (optarg, &end, 0);
+           if (*end != '\0')
+             einfo (_("%F%P: invalid cache memory size: %s\n"),
+                    optarg);
+           link_info.max_cache_size = cache_size;
+         }
+         break;
+
        case OPTION_HASH_SIZE:
          {
            bfd_size_type new_size;