aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-03-17 07:07:21 +0000
committerIan Lance Taylor <ian@airs.com>2009-03-17 07:07:21 +0000
commit8c50070107224cdda510640738eca333f67409ee (patch)
tree8d2dced8570857a0bf78e5dcad5a3c4464d8d80a /gold/symtab.h
parentb646ddd43a01254d0be446b8a8dd1a9135a758e4 (diff)
downloadgdb-8c50070107224cdda510640738eca333f67409ee.zip
gdb-8c50070107224cdda510640738eca333f67409ee.tar.gz
gdb-8c50070107224cdda510640738eca333f67409ee.tar.bz2
* symtab.cc (Symbol_table::define_default_version): New function,
broken out of add_from_object. (Symbol_table::add_from_object): Call define_default_version. (Symbol_table::define_special_symbol): Add resolve_oldsym parameter. Change all callers. If the version for a symbol comes from a version script, resolve it with the symbol with the same name with no version. Also add the symbol without a version if appropriate. (do_define_in_output_data): If resolving with oldsym, don't delete sym. (do_define_in_output_segment): Likewise. (do_define_as_constant): Likewise. * symtab.h (class Symbol_table): Update declarations.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h47
1 files changed, 27 insertions, 20 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index 003318c..c96c6fb 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -1367,6 +1367,25 @@ class Symbol_table
// The type of the list of common symbols.
typedef std::vector<Symbol*> Commons_type;
+ // The type of the symbol hash table.
+
+ typedef std::pair<Stringpool::Key, Stringpool::Key> Symbol_table_key;
+
+ struct Symbol_table_hash
+ {
+ size_t
+ operator()(const Symbol_table_key&) const;
+ };
+
+ struct Symbol_table_eq
+ {
+ bool
+ operator()(const Symbol_table_key&, const Symbol_table_key&) const;
+ };
+
+ typedef Unordered_map<Symbol_table_key, Symbol*, Symbol_table_hash,
+ Symbol_table_eq> Symbol_table_type;
+
// Make FROM a forwarder symbol to TO.
void
make_forwarder(Symbol* from, Symbol* to);
@@ -1380,6 +1399,12 @@ class Symbol_table
unsigned int st_shndx, bool is_ordinary,
unsigned int orig_st_shndx);
+ // Define a default symbol.
+ template<int size, bool big_endian>
+ void
+ define_default_version(Sized_symbol<size>*, bool,
+ Symbol_table_type::iterator);
+
// Resolve symbols.
template<int size, bool big_endian>
void
@@ -1435,7 +1460,8 @@ class Symbol_table
template<int size, bool big_endian>
Sized_symbol<size>*
define_special_symbol(const char** pname, const char** pversion,
- bool only_if_ref, Sized_symbol<size>** poldsym);
+ bool only_if_ref, Sized_symbol<size>** poldsym,
+ bool* resolve_oldsym);
// Define a symbol in an Output_data, sized version.
template<int size>
@@ -1531,25 +1557,6 @@ class Symbol_table
sized_write_section_symbol(const Output_section*, Output_symtab_xindex*,
Output_file*, off_t) const;
- // The type of the symbol hash table.
-
- typedef std::pair<Stringpool::Key, Stringpool::Key> Symbol_table_key;
-
- struct Symbol_table_hash
- {
- size_t
- operator()(const Symbol_table_key&) const;
- };
-
- struct Symbol_table_eq
- {
- bool
- operator()(const Symbol_table_key&, const Symbol_table_key&) const;
- };
-
- typedef Unordered_map<Symbol_table_key, Symbol*, Symbol_table_hash,
- Symbol_table_eq> Symbol_table_type;
-
// The type of the list of symbols which have been forced local.
typedef std::vector<Symbol*> Forced_locals;