diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-24 18:17:57 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-24 18:17:57 +0800 |
commit | fd6fc0c5f6ec26b3b526655a721b7b0af0b14644 (patch) | |
tree | 487c69cb82b68612b53ad40569a54e060973eca2 /binutils-2.25/gold/plugin.cc | |
parent | aff326d7fffe9111be0900d433c6de6661c48af3 (diff) | |
download | toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.zip toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.tar.gz toolchain_binutils-fd6fc0c5f6ec26b3b526655a721b7b0af0b14644.tar.bz2 |
Update binutils-2.25/gold to ToT
commit be66981e1605eff305ac9c561825f4bd6801fca2
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Feb 22 05:18:50 2015 -0800
Set GOLD_DEFAULT_SIZE to 32 for x32
* configure.ac (default_size): Set to 32 for x32.
* configure: Regenerated.
Change-Id: I4b2d8927e4e41cf2fac3c92d00e8aef69b5ce21f
Diffstat (limited to 'binutils-2.25/gold/plugin.cc')
-rw-r--r-- | binutils-2.25/gold/plugin.cc | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/binutils-2.25/gold/plugin.cc b/binutils-2.25/gold/plugin.cc index 0339d42..68da8e3 100644 --- a/binutils-2.25/gold/plugin.cc +++ b/binutils-2.25/gold/plugin.cc @@ -1,6 +1,6 @@ // plugin.cc -- plugin manager for gold -*- C++ -*- -// Copyright (C) 2008-2014 Free Software Foundation, Inc. +// Copyright (C) 2008-2015 Free Software Foundation, Inc. // Written by Cary Coutant <ccoutant@google.com>. // This file is part of gold. @@ -427,6 +427,7 @@ Plugin_manager::~Plugin_manager() ++obj) delete *obj; this->objects_.clear(); + delete this->lock_; } // Load all plugin libraries. @@ -447,6 +448,10 @@ Pluginobj* Plugin_manager::claim_file(Input_file* input_file, off_t offset, off_t filesize, Object* elf_object) { + bool lock_initialized = this->initialize_lock_.initialize(); + + gold_assert(lock_initialized); + Hold_lock hl(*this->lock_); if (this->in_replacement_phase_) return NULL; @@ -909,7 +914,8 @@ is_visible_from_outside(Symbol* lsym) // Get symbol resolution info. ld_plugin_status -Pluginobj::get_symbol_resolution_info(int nsyms, +Pluginobj::get_symbol_resolution_info(Symbol_table* symtab, + int nsyms, ld_plugin_symbol* syms, int version) const { @@ -938,6 +944,8 @@ Pluginobj::get_symbol_resolution_info(int nsyms, { ld_plugin_symbol* isym = &syms[i]; Symbol* lsym = this->symbols_[i]; + if (lsym->is_forwarder()) + lsym = symtab->resolve_forwards(lsym); ld_plugin_symbol_resolution res = LDPR_UNKNOWN; if (lsym->is_undefined()) @@ -1506,14 +1514,16 @@ static enum ld_plugin_status get_symbols(const void* handle, int nsyms, ld_plugin_symbol* syms) { gold_assert(parameters->options().has_plugins()); - Object* obj = parameters->options().plugins()->object( + Plugin_manager* plugins = parameters->options().plugins(); + Object* obj = plugins->object( static_cast<unsigned int>(reinterpret_cast<intptr_t>(handle))); if (obj == NULL) return LDPS_ERR; Pluginobj* plugin_obj = obj->pluginobj(); if (plugin_obj == NULL) return LDPS_ERR; - return plugin_obj->get_symbol_resolution_info(nsyms, syms, 1); + Symbol_table* symtab = plugins->symtab(); + return plugin_obj->get_symbol_resolution_info(symtab, nsyms, syms, 1); } // Version 2 of the above. The only difference is that this version @@ -1523,14 +1533,16 @@ static enum ld_plugin_status get_symbols_v2(const void* handle, int nsyms, ld_plugin_symbol* syms) { gold_assert(parameters->options().has_plugins()); - Object* obj = parameters->options().plugins()->object( + Plugin_manager* plugins = parameters->options().plugins(); + Object* obj = plugins->object( static_cast<unsigned int>(reinterpret_cast<intptr_t>(handle))); if (obj == NULL) return LDPS_ERR; Pluginobj* plugin_obj = obj->pluginobj(); if (plugin_obj == NULL) return LDPS_ERR; - return plugin_obj->get_symbol_resolution_info(nsyms, syms, 2); + Symbol_table* symtab = plugins->symtab(); + return plugin_obj->get_symbol_resolution_info(symtab, nsyms, syms, 2); } // Add a new (real) input file generated by a plugin. |