diff options
author | Nick Clifton <nickc@redhat.com> | 2006-08-04 14:53:26 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2006-08-04 14:53:26 +0000 |
commit | c17d87de17351aed016a9d0b0712cdee4cca5f9e (patch) | |
tree | 13f06eeffc7669d44e8c5af57f8e7871ddef110b /bfd | |
parent | 55e6e39790fd27daea0bf1af3b9a7797c735a79f (diff) | |
download | gdb-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 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 401c6b3..0ba154d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Marcelo Tosatti <marcelo@kvack.org> + + * elflink.c (elf_gc_sweep): If info.print_gc_sections is true, + list removed sections to stderr. + 2006-08-04 Richard Sandiford <richard@codesourcery.com> Kazu Hirata <kazu@codesourcery.com> Phil Edwards <phil@codesourcery.com> diff --git a/bfd/elflink.c b/bfd/elflink.c index 99f0acc..ba0e77e 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -9356,7 +9356,8 @@ _bfd_elf_gc_mark (struct bfd_link_info *info, /* Sweep symbols in swept sections. Called via elf_link_hash_traverse. */ -struct elf_gc_sweep_symbol_info { +struct elf_gc_sweep_symbol_info +{ struct bfd_link_info *info; void (*hide_symbol) (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); @@ -9419,6 +9420,9 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) to remove a section from the output. */ o->flags |= SEC_EXCLUDE; + if (info->print_gc_sections == TRUE) + _bfd_error_handler (_("Removing unused section '%s' in file '%B'"), sub, o->name); + /* But we also have to update some of the relocation info we collected before. */ if (gc_sweep_hook |