From 3604cb1f8ca4a926039a9540d03bb224d84af3e1 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 5 Jun 2015 15:09:31 +0200 Subject: Add new ld option: --print-memory-usage ld/ * NEWS: Mention new option. * lexsup.c (parse_args): Handle --print-memory-usage. (ld_options): Add --print-memory-usage. * ldmain.c (main): Call lang_print_memory_usage. * ldlex.h (enum option_values): Add OPTION_PRINT_MEMORY_USAGE. * ldlang.h: Add prototype of lang_print_memory_usage. * ldlang.c (lang_print_memory_size, lang_print_memory_usage): New functions. * ld.texinfo (Options): Document --print-memory-usage. * ld.h (args_type): Add print_memory_usage field. ld/testsuite/ * ld-scripts/print-memory-usage-1.t, * ld-scripts/print-memory-usage-1.s, * ld-scripts/print-memory-usage-1.l, * ld-scripts/print-memory-usage-2.t, * ld-scripts/print-memory-usage-2.l, * ld-scripts/print-memory-usage-3.s, * ld-scripts/print-memory-usage-3.t, * ld-scripts/print-memory-usage-3.l, * ld-scripts/print-memory-usage.t: New tests. * ld-scripts/print-memory-usage.exp: Run them. --- ld/ldmain.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ld/ldmain.c') diff --git a/ld/ldmain.c b/ld/ldmain.c index a7b72bd63f8..04920343e1a 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -440,6 +440,8 @@ main (int argc, char **argv) output_cref (config.map_file != NULL ? config.map_file : stdout); if (nocrossref_list != NULL) check_nocrossrefs (); + if (command_line.print_memory_usage) + lang_print_memory_usage (); #if 0 { struct bfd_link_hash_entry * h; -- cgit v1.2.1