diff options
author | Cary Coutant <ccoutant@google.com> | 2014-03-10 13:33:20 -0700 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2014-03-10 13:33:20 -0700 |
commit | 98ff9231545f9ba7221ad64ec1ff17cf52cafc07 (patch) | |
tree | ad1b708df3ac5802a174404b804ef096222f0a64 /gold/symtab.cc | |
parent | ce15efd88c41c2b323ef37aed9c24f0557d8b2ca (diff) | |
download | gdb-98ff9231545f9ba7221ad64ec1ff17cf52cafc07.zip gdb-98ff9231545f9ba7221ad64ec1ff17cf52cafc07.tar.gz gdb-98ff9231545f9ba7221ad64ec1ff17cf52cafc07.tar.bz2 |
Allow target to set dynsym indexes.
2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
gold/
* symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
dynsym indexes.
* target.h (Target::has_custom_set_dynsym_indexes): New function.
(Target::do_has_custom_set_dynsym_indexes): New function.
(Target::set_dynsym_indexes): New function.
(Target::do_set_dynsym_indexes): New function.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r-- | gold/symtab.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc index 363653e..87173b2 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -2371,6 +2371,25 @@ Symbol_table::set_dynsym_indexes(unsigned int index, { std::vector<Symbol*> as_needed_sym; + // Allow a target to set dynsym indexes. + if (parameters->target().has_custom_set_dynsym_indexes()) + { + std::vector<Symbol*> dyn_symbols; + for (Symbol_table_type::iterator p = this->table_.begin(); + p != this->table_.end(); + ++p) + { + Symbol* sym = p->second; + if (!sym->should_add_dynsym_entry(this)) + sym->set_dynsym_index(-1U); + else + dyn_symbols.push_back(sym); + } + + return parameters->target().set_dynsym_indexes(&dyn_symbols, index, syms, + dynpool, versions, this); + } + for (Symbol_table_type::iterator p = this->table_.begin(); p != this->table_.end(); ++p) |