summaryrefslogtreecommitdiff
path: root/gold/dynobj.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-05 21:52:50 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-05 21:52:50 +0000
commit7d6258c030129a1c24e3b18ff2414030bc37bfe0 (patch)
tree46b16e3f963cacc79f7b1275fac175cf7cc7429c /gold/dynobj.cc
parent5e5ca4fd3afebd674e0f55344e83ba43bf5128ef (diff)
downloadbinutils-redhat-7d6258c030129a1c24e3b18ff2414030bc37bfe0.tar.gz
PR 10980
* options.h (class General_options): Add --cref. * main.cc (main): Print cref table if --cref. Don't close mapfile until after printing cref table. * cref.cc: Include "symtab.h". (class Cref_inputs): Define Cref_table_compare and Cref_table. (Cref_table_compare::operator()): New function. (Cref_inputs::gather_cref): New function. (filecol): New static const. (Cref_inputs::print_cref): New function. (Cref::print_cref): New function. * cref.h: Include <cstdio>. (class Cref): Update declarations. * mapfile.h (Mapfile::file): New function. * object.h (class Object): Define Symbols. Declare virtual do_get_global_symbols. (Object::get_global_symbols): New function. * object.cc (Input_objects::add_object): Pass object to cref_ if --cref. (Input_objects::archive_start): Likewise. (Input_objects::archive_stop): Likewise. (Input_objects::print_cref): New function. * dynobj.h (Sized_dynobj::do_get_global_symbols): New function. * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if --cref. * plugin.cc (Sized_pluginobj::do_get_global_symbols): New function. * plugin.h (class Sized_pluginobj): Update declarations.
Diffstat (limited to 'gold/dynobj.cc')
-rw-r--r--gold/dynobj.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/gold/dynobj.cc b/gold/dynobj.cc
index f982c4b469..fac8715d41 100644
--- a/gold/dynobj.cc
+++ b/gold/dynobj.cc
@@ -1,6 +1,6 @@
// dynobj.cc -- dynamic object support for gold
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
@@ -682,9 +682,10 @@ Sized_dynobj<size, big_endian>::do_add_symbols(Symbol_table* symtab,
Version_map version_map;
this->make_version_map(sd, &version_map);
- // If printing symbol counts, we want to track symbols.
-
- if (parameters->options().user_set_print_symbol_counts())
+ // If printing symbol counts or a cross reference table, we want to
+ // track symbols.
+ if (parameters->options().user_set_print_symbol_counts()
+ || parameters->options().cref())
{
this->symbols_ = new Symbols();
this->symbols_->resize(symcount);