summaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2016-02-04 16:55:39 -0800
committerCary Coutant <ccoutant@gmail.com>2016-03-03 18:19:53 -0800
commitdc1c8a16a38dec431c77f49cf50a9b62d6366138 (patch)
treedde11c01459658ee118c3eefe93f8343beb9d623 /gold/symtab.h
parent8b4ee0a5c134be874ba44038d2fbd4d9b7f6d3ee (diff)
downloadbinutils-gdb-dc1c8a16a38dec431c77f49cf50a9b62d6366138.tar.gz
Add support for STT_SPARC_REGISTER symbols.
gold/ PR gold/19019 * layout.h (Layout::add_target_specific_dynamic_tag): New function. * layout.cc (Layout::add_target_specific_dynamic_tag): New function. * mips.cc (Target_mips::make_symbol): Adjust function signature. * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_. (Target_sparc::do_is_defined_by_abi): Remove test for STT_SPARC_REGISTER. (Target_sparc::Register_symbol): New struct type. (Target_sparc::register_syms_): New data member. (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true. (Target_sparc::make_symbol): New function. (Target_sparc::do_finalize_sections): Add register symbols and new dynamic table entries. * symtab.h (Sized_symbol::init_undefined): Add value parameter. (Symbol_table::add_target_global_symbol): New function. (Symbol_table::target_symbols_): New data member. * symtab.cc (Sized_symbol::init_undefined): Add value parameter. (Symbol_table::Symbol_table): Initialize target_symbols_. (Symbol_table::add_from_object): Pass additional parameters to Target::make_symbol. (Symbol_table::define_special_symbol): Likewise. (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for undefined symbol value. (Symbol_table::set_dynsym_indexes): Process target-specific symbols. (Symbol_table::sized_finalize): Likewise. (Symbol_table::sized_write_globals): Likewise. * target.h (Sized_target::make_symbol): Add name, st_type, object, st_shndx, and value parameters.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index 764ef4622a8..5cee458f1a2 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -1113,8 +1113,8 @@ class Sized_symbol : public Symbol
// Initialize fields for an undefined symbol.
void
- init_undefined(const char* name, const char* version, elfcpp::STT,
- elfcpp::STB, elfcpp::STV, unsigned char nonvis);
+ init_undefined(const char* name, const char* version, Value_type value,
+ elfcpp::STT, elfcpp::STB, elfcpp::STV, unsigned char nonvis);
// Override existing symbol.
template<bool big_endian>
@@ -1481,6 +1481,12 @@ class Symbol_table
define_symbols(const Layout*, int count, const Define_symbol_in_segment*,
bool only_if_ref);
+ // Add a target-specific global symbol.
+ // (Used by SPARC backend to add STT_SPARC_REGISTER symbols.)
+ void
+ add_target_global_symbol(Symbol* sym)
+ { this->target_symbols_.push_back(sym); }
+
// Define SYM using a COPY reloc. POSD is the Output_data where the
// symbol should be defined--typically a .dyn.bss section. VALUE is
// the offset within POSD.
@@ -1951,6 +1957,8 @@ class Symbol_table
const Version_script_info& version_script_;
Garbage_collection* gc_;
Icf* icf_;
+ // Target-specific symbols, if any.
+ std::vector<Symbol*> target_symbols_;
};
// We inline get_sized_symbol for efficiency.