aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-08-04 14:53:26 +0000
committerNick Clifton <nickc@redhat.com>2006-08-04 14:53:26 +0000
commitc17d87de17351aed016a9d0b0712cdee4cca5f9e (patch)
tree13f06eeffc7669d44e8c5af57f8e7871ddef110b /ld/lexsup.c
parent55e6e39790fd27daea0bf1af3b9a7797c735a79f (diff)
downloadgdb-c17d87de17351aed016a9d0b0712cdee4cca5f9e.zip
gdb-c17d87de17351aed016a9d0b0712cdee4cca5f9e.tar.gz
gdb-c17d87de17351aed016a9d0b0712cdee4cca5f9e.tar.bz2
* ldmain.c (main): Initialise print_gc_sections field of link_info structure.
* lexsup.c: Add --print-gc-sections and --no-print-gc-sections switches. * ld.texinfo: Document new switches. * NEWS: Mention new switches. * bfdlink.h (struct bfd_link_info): New field: print_gc_sections. * elflink.c (elf_gc_sweep): If info.print_gc_sections is true, list removed sections to stderr.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index c2bef1d..4d526b0 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -124,6 +124,8 @@ enum option_values
OPTION_FORCE_EXE_SUFFIX,
OPTION_GC_SECTIONS,
OPTION_NO_GC_SECTIONS,
+ OPTION_PRINT_GC_SECTIONS,
+ OPTION_NO_PRINT_GC_SECTIONS,
OPTION_HASH_SIZE,
OPTION_CHECK_SECTIONS,
OPTION_NO_CHECK_SECTIONS,
@@ -370,6 +372,12 @@ static const struct ld_option ld_options[] =
{ {"no-gc-sections", no_argument, NULL, OPTION_NO_GC_SECTIONS},
'\0', NULL, N_("Don't remove unused sections (default)"),
TWO_DASHES },
+ { {"print-gc-sections", no_argument, NULL, OPTION_PRINT_GC_SECTIONS},
+ '\0', NULL, N_("List removed unused sections on stderr"),
+ TWO_DASHES },
+ { {"no-print-gc-sections", no_argument, NULL, OPTION_NO_PRINT_GC_SECTIONS},
+ '\0', NULL, N_("Do not list removed 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 },
@@ -812,6 +820,9 @@ parse_args (unsigned argc, char **argv)
case OPTION_GC_SECTIONS:
link_info.gc_sections = TRUE;
break;
+ case OPTION_PRINT_GC_SECTIONS:
+ link_info.print_gc_sections = TRUE;
+ break;
case OPTION_HELP:
help ();
xexit (0);
@@ -855,6 +866,9 @@ parse_args (unsigned argc, char **argv)
case OPTION_NO_GC_SECTIONS:
link_info.gc_sections = FALSE;
break;
+ case OPTION_NO_PRINT_GC_SECTIONS:
+ link_info.print_gc_sections = FALSE;
+ break;
case OPTION_NO_KEEP_MEMORY:
link_info.keep_memory = FALSE;
break;