+2020-11-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/26200
+ * plugin.cc (Plugin_manager::claim_file): Don't share Plugin_list
+ iterator.
+ (Plugin_manager::all_symbols_read): Likewise.
+ (Plugin_manager::cleanup): Likewise.
+
2020-11-03 Alan Modra <amodra@gmail.com>
* powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer.
this->objects_.push_back(elf_object);
this->in_claim_file_handler_ = true;
- for (this->current_ = this->plugins_.begin();
- this->current_ != this->plugins_.end();
- ++this->current_)
+ for (Plugin_list::iterator p = this->plugins_.begin();
+ p != this->plugins_.end();
+ ++p)
{
// If we aren't yet in replacement phase, allow plugins to claim input
// files, otherwise notify the plugin of the new input file, if needed.
if (!this->in_replacement_phase_)
- {
- if ((*this->current_)->claim_file(&this->plugin_input_file_))
- {
- this->any_claimed_ = true;
+ {
+ if ((*p)->claim_file(&this->plugin_input_file_))
+ {
+ this->any_claimed_ = true;
this->in_claim_file_handler_ = false;
if (this->recorder_ != NULL)
: elf_object->name());
this->recorder_->claimed_file(objname,
offset, filesize,
- (*this->current_)->filename());
+ (*p)->filename());
}
if (this->objects_.size() > handle
}
else
{
- (*this->current_)->new_input(&this->plugin_input_file_);
+ (*p)->new_input(&this->plugin_input_file_);
}
}
layout->script_options()->set_defsym_uses_in_real_elf(symtab);
layout->script_options()->find_defsym_defs(this->defsym_defines_set_);
- for (this->current_ = this->plugins_.begin();
- this->current_ != this->plugins_.end();
- ++this->current_)
- (*this->current_)->all_symbols_read();
+ for (Plugin_list::iterator p = this->plugins_.begin();
+ p != this->plugins_.end();
+ ++p)
+ (*p)->all_symbols_read();
if (this->any_added_)
{
close_all_descriptors();
}
- for (this->current_ = this->plugins_.begin();
- this->current_ != this->plugins_.end();
- ++this->current_)
- (*this->current_)->cleanup();
+ for (Plugin_list::iterator p = this->plugins_.begin();
+ p != this->plugins_.end();
+ ++p)
+ (*p)->cleanup();
}
// Make a new Pluginobj object. This is called when the plugin calls