aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-05 21:52:51 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-05 21:52:51 +0000
commitdde3f402cfe649f271730fa5de983ee663743ea3 (patch)
treeca56e62c8e4e0b6e57743388d5f1f282cc584869 /gold/object.h
parent43e85a8f541dcc299092452d816749cf99e31d60 (diff)
downloadgdb-dde3f402cfe649f271730fa5de983ee663743ea3.zip
gdb-dde3f402cfe649f271730fa5de983ee663743ea3.tar.gz
gdb-dde3f402cfe649f271730fa5de983ee663743ea3.tar.bz2
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/object.h')
-rw-r--r--gold/object.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/gold/object.h b/gold/object.h
index 187a101..26e85f5 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -1,6 +1,6 @@
// object.h -- support for an object file for linking in gold -*- C++ -*-
-// Copyright 2006, 2007, 2008, 2009 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.
@@ -188,6 +188,8 @@ class Xindex
class Object
{
public:
+ typedef std::vector<Symbol*> Symbols;
+
// NAME is the name of the object as we would report it to the user
// (e.g., libfoo.a(bar.o) if this is in an archive. INPUT_FILE is
// used to read the file. OFFSET is the offset within the input
@@ -466,6 +468,11 @@ class Object
size_t* used) const
{ this->do_get_global_symbol_counts(symtab, defined, used); }
+ // Get the symbols defined in this object.
+ const Symbols*
+ get_global_symbols() const
+ { return this->do_get_global_symbols(); }
+
// Return whether this object was found in a system directory.
bool
is_in_system_directory() const
@@ -553,6 +560,9 @@ class Object
virtual void
do_get_global_symbol_counts(const Symbol_table*, size_t*, size_t*) const = 0;
+ virtual const Symbols*
+ do_get_global_symbols() const = 0;
+
// Set the number of sections.
void
set_shnum(int shnum)
@@ -1596,6 +1606,11 @@ class Sized_relobj : public Relobj
void
do_get_global_symbol_counts(const Symbol_table*, size_t*, size_t*) const;
+ // Get the global symbols.
+ const Symbols*
+ do_get_global_symbols() const
+ { return &this->symbols_; }
+
// Get the offset of a section.
uint64_t
do_output_section_offset(unsigned int shndx) const
@@ -1960,6 +1975,10 @@ class Input_objects
void
print_symbol_counts(const Symbol_table*) const;
+ // Print a cross reference table.
+ void
+ print_cref(const Symbol_table*, FILE*) const;
+
// Iterate over all regular objects.
Relobj_iterator