OSDN Git Service

* cref.cc: New file.
authorIan Lance Taylor <ian@airs.com>
Tue, 22 Jul 2008 22:08:43 +0000 (22:08 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 22 Jul 2008 22:08:43 +0000 (22:08 +0000)
commitb74e66c7df4db0fccc0326e44c80cf48b99da1b4
treefeebdcc5ea9591a5544aeba755b50b0d436d214d
parent9d571a023763bf386e230f1c4812c4f457d41fc3
* cref.cc: New file.
* cref.h: New file.
* options.h (class General_options): Add --print-symbol-counts.
* main.cc (main): Issue defined symbol report if requested.
* archive.cc (Archive::interpret_header): Make into a const member
function.
(Archive::add_symbols): Call Input_objects::archive_start and
archive_stop.
(Archive::const_iterator): Define new class.
(Archive::begin, Archive::end): New functions.
(Archive::include_all_members): Rewrite to use iterator.
(Archive::count_members): New function.
* archive.h (class Archive): Update declarations.
(Archive::filename): New function.
* object.cc: Include "cref.h".
(Sized_relobj::Sized_relobj): Initialize defined_count_.
(Sized_relobj::do_get_global_symbol_counts): New function.
(Input_objects::add_object): Add object to cross-referencer.
(Input_objects::archive_start): New function.
(Input_objects::archive_stop): New function.
(Input_objects::print_symbol_counts): New function.
* object.h: Declare Cref and Archive.
(Object::get_global_symbol_counts): New function.
(Object::do_get_global_symbol_counts): New pure virtual function.
(class Sized_relobj): Add defined_count_ field.  Update
declarations.
(class Input_objects): Add cref_ field.  Update constructor.
Update declarations.
* dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
defined_count_.
(Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
symbol counts.
(Sized_dynobj::do_get_global_symbol_counts): New function.
* dynobj.h (class Sized_dynobj): Add fields symbols_ and
defined_count_.  Update declarations.  Define Symbols typedef.
* symtab.cc (Symbol_table::add_from_relobj): Add defined
parameter.  Change all callers.
(Symbol_table::add_from_dynobj): Add sympointers and defined
parameters.  Change all callers.
* symtab.h (class Symbol_table): Update declarations.
* Makefile.am (CCFILES): Add cref.cc.
(HFILES): Add cref.h.
* Makefile.in: Rebuild.
15 files changed:
gold/ChangeLog
gold/Makefile.am
gold/Makefile.in
gold/archive.cc
gold/archive.h
gold/cref.cc [new file with mode: 0644]
gold/cref.h [new file with mode: 0644]
gold/dynobj.cc
gold/dynobj.h
gold/main.cc
gold/object.cc
gold/object.h
gold/options.h
gold/symtab.cc
gold/symtab.h