diff options
Diffstat (limited to 'gold/symtab.h')
-rw-r--r-- | gold/symtab.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gold/symtab.h b/gold/symtab.h index 88d6c2782ba..a67d5eb90d4 100644 --- a/gold/symtab.h +++ b/gold/symtab.h @@ -329,6 +329,11 @@ class Symbol set_in_reg() { this->in_reg_ = true; } + // Forget this symbol was seen in a regular object. + void + clear_in_reg() + { this->in_reg_ = false; } + // Return whether this symbol has been seen in a dynamic object. bool in_dyn() const @@ -893,6 +898,13 @@ class Symbol set_non_zero_localentry() { this->non_zero_localentry_ = true; } + // Completely override existing symbol. Everything bar name_, + // version_, and is_forced_local_ flag are copied. version_ is + // cleared if from->version_ is clear. Returns true if this symbol + // should be forced local. + bool + clone(const Symbol* from); + protected: // Instances of this class should always be created at a specific // size. @@ -1182,6 +1194,13 @@ class Sized_symbol : public Symbol void allocate_common(Output_data*, Value_type value); + // Completely override existing symbol. Everything bar name_, + // version_, and is_forced_local_ flag are copied. version_ is + // cleared if from->version_ is clear. Returns true if this symbol + // should be forced local. + bool + clone(const Sized_symbol<size>* from); + private: Sized_symbol(const Sized_symbol&); Sized_symbol& operator=(const Sized_symbol&); @@ -1687,6 +1706,15 @@ class Symbol_table version_script() const { return version_script_; } + // Completely override existing symbol. + template<int size> + void + clone(Sized_symbol<size>* to, const Sized_symbol<size>* from) + { + if (to->clone(from)) + this->force_local(to); + } + private: Symbol_table(const Symbol_table&); Symbol_table& operator=(const Symbol_table&); |