aboutsummaryrefslogtreecommitdiff
path: root/gold/target.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2014-03-10 13:33:20 -0700
committerCary Coutant <ccoutant@google.com>2014-03-10 13:33:20 -0700
commit98ff9231545f9ba7221ad64ec1ff17cf52cafc07 (patch)
treead1b708df3ac5802a174404b804ef096222f0a64 /gold/target.h
parentce15efd88c41c2b323ef37aed9c24f0557d8b2ca (diff)
downloadgdb-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/target.h')
-rw-r--r--gold/target.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/gold/target.h b/gold/target.h
index 8dabc28..1be300a 100644
--- a/gold/target.h
+++ b/gold/target.h
@@ -36,6 +36,7 @@
#include "elfcpp.h"
#include "options.h"
#include "parameters.h"
+#include "stringpool.h"
#include "debug.h"
namespace gold
@@ -61,6 +62,7 @@ class Output_section;
class Input_objects;
class Task;
struct Symbol_location;
+class Versions;
// The abstract class for target specific handling.
@@ -453,6 +455,21 @@ class Target
entry_symbol_name() const
{ return this->pti_->entry_symbol_name; }
+ // Whether the target has a custom set_dynsym_indexes method.
+ bool
+ has_custom_set_dynsym_indexes() const
+ { return this->do_has_custom_set_dynsym_indexes(); }
+
+ // Custom set_dynsym_indexes method for a target.
+ unsigned int
+ set_dynsym_indexes(std::vector<Symbol*>* dyn_symbols, unsigned int index,
+ std::vector<Symbol*>* syms, Stringpool* dynpool,
+ Versions* versions, Symbol_table* symtab) const
+ {
+ return this->do_set_dynsym_indexes(dyn_symbols, index, syms, dynpool,
+ versions, symtab);
+ }
+
protected:
// This struct holds the constant information for a child class. We
// use a struct to avoid the overhead of virtual function calls for
@@ -724,6 +741,18 @@ class Target
do_gc_mark_symbol(Symbol_table*, Symbol*) const
{ }
+ // This may be overridden by the child class.
+ virtual bool
+ do_has_custom_set_dynsym_indexes() const
+ { return false; }
+
+ // This may be overridden by the child class.
+ virtual unsigned int
+ do_set_dynsym_indexes(std::vector<Symbol*>*, unsigned int,
+ std::vector<Symbol*>*, Stringpool*, Versions*,
+ Symbol_table*) const
+ { gold_unreachable(); }
+
private:
// The implementations of the four do_make_elf_object virtual functions are
// almost identical except for their sizes and endianness. We use a template.