From badc813953563b5539ce2974242b9c3d3860adab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Fri, 18 Feb 2011 14:55:33 +0000 Subject: [PATCH] =?utf8?q?2010-02-18=20=20Rafael=20=C3=81vila=20de=20Esp?= =?utf8?q?=C3=ADndola=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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. --- gold/ChangeLog | 7 +++++++ gold/symtab.cc | 14 ++++++++++++++ 2 files changed, 21 insertions(+) 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); -- 2.30.2