From: Rafael Ávila de Espíndola Date: Fri, 18 Feb 2011 14:55:33 +0000 (+0000) Subject: 2010-02-18 Rafael Ávila de Espíndola X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=badc813953563b5539ce2974242b9c3d3860adab;p=binutils-gdb.git 2010-02-18 Rafael Ávila de Espíndola * symtab.cc (Symbol::should_add_dynsym_entry) Return false for plugin only symbols. (Symbol_table::sized_finalize_symbol) Mark symbol only present in plugin files as not needed in the symbol table. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 6bdc568fbcc..e7676ca2c7f 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,10 @@ +2010-02-18 Rafael Ávila de Espíndola + + * symtab.cc (Symbol::should_add_dynsym_entry) Return false for + plugin only symbols. + (Symbol_table::sized_finalize_symbol) Mark symbol only present + in plugin files as not needed in the symbol table. + 2011-02-11 Sriraman Tallam * output.cc (Output_section::add_input_section): Delay fill diff --git a/gold/symtab.cc b/gold/symtab.cc index cb650fb088a..d4ac297792a 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -310,6 +310,11 @@ Sized_symbol::allocate_common(Output_data* od, Value_type value) inline bool Symbol::should_add_dynsym_entry(Symbol_table* symtab) const { + // If the symbol is only present on plugin files, the plugin decided we + // don't need it. + if (!this->in_real_elf()) + return false; + // If the symbol is used by a dynamic relocation, we need to add it. if (this->needs_dynsym_entry()) return true; @@ -2593,6 +2598,15 @@ Symbol_table::sized_finalize_symbol(Symbol* unsized_sym) return false; } + // If the symbol is only present on plugin files, the plugin decided we + // don't need it. + if (!sym->in_real_elf()) + { + gold_assert(!sym->has_symtab_index()); + sym->set_symtab_index(-1U); + return false; + } + // Compute final symbol value. Compute_final_value_status status; Value_type value = this->compute_final_value(sym, &status);