diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/NEWS | 3 | ||||
-rw-r--r-- | ld/ld.texi | 6 | ||||
-rw-r--r-- | ld/ldlex.h | 1 | ||||
-rw-r--r-- | ld/ldmain.c | 1 | ||||
-rw-r--r-- | ld/lexsup.c | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-bootstrap/bootstrap.exp | 3 |
6 files changed, 28 insertions, 1 deletions
@@ -1,5 +1,8 @@ -*- text -*- +* Add --max-cache-size=SIZE to set the the maximum cache size to SIZE + bytes. + Changes in 2.37: * arm-symbianelf support removed. @@ -2839,6 +2839,12 @@ has been used. The @option{--reduce-memory-overheads} switch may be also be used to enable other tradeoffs in future versions of the linker. +@kindex --max-cache-size=@var{size} +@item --max-cache-size=@var{size} +@command{ld} normally caches the relocation information and symbol tables +of input files in memory with the unlimited size. This option sets the +maximum cache size to @var{size}. + @kindex --build-id @kindex --build-id=@var{style} @item --build-id @@ -140,6 +140,7 @@ enum option_values OPTION_WARN_TEXTREL, OPTION_WARN_ALTERNATE_EM, OPTION_REDUCE_MEMORY_OVERHEADS, + OPTION_MAX_CACHE_SIZE, #if BFD_SUPPORTS_PLUGINS OPTION_PLUGIN, OPTION_PLUGIN_OPT, diff --git a/ld/ldmain.c b/ld/ldmain.c index 42660eb..e4c6774 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -331,6 +331,7 @@ main (int argc, char **argv) link_info.allow_undefined_version = true; link_info.keep_memory = true; + link_info.max_cache_size = (bfd_size_type) -1; link_info.combreloc = true; link_info.strip_discarded = true; link_info.prohibit_multiple_definition_absolute = false; diff --git a/ld/lexsup.c b/ld/lexsup.c index 00274c5..c128fe3 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -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; diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp index b21b48a..9c27c5f 100644 --- a/ld/testsuite/ld-bootstrap/bootstrap.exp +++ b/ld/testsuite/ld-bootstrap/bootstrap.exp @@ -55,7 +55,8 @@ if [check_plugin_api_available] { # really test -r. Use ld1 to link a fresh ld, ld2. Use ld2 to link a # new ld, ld3. ld2 and ld3 should be identical. set test_flags {"" "strip" "--static" "-Wl,--traditional-format" - "-Wl,--no-keep-memory" "-Wl,--relax"} + "-Wl,--no-keep-memory" "-Wl,--relax" + "-Wl,--max-cache-size=-1"} if { [istarget "powerpc-*-*"] } { lappend test_flags "-Wl,--ppc476-workaround" } |