-// plugin.c -- plugin manager for gold -*- C++ -*-
+// plugin.cc -- plugin manager for gold -*- C++ -*-
// Copyright 2008, 2009 Free Software Foundation, Inc.
// Written by Cary Coutant <ccoutant@google.com>.
// If this is the first time we've seen this comdat key, ask the
// layout object whether it should be included.
if (ins.second)
- ins.first->second = layout->add_comdat(NULL, 1, comdat_key, true);
+ {
+ Kept_section to_add(NULL, 1, true);
+ ins.first->second = layout->find_or_add_kept_section(comdat_key,
+ &to_add,
+ NULL);
+ }
return ins.first->second;
}
// Add the symbols to the symbol table.
-template<int size, bool big_endian>
-void
-Sized_pluginobj<size, big_endian>::do_add_symbols(Symbol_table*,
- Read_symbols_data*)
-{
- gold_unreachable();
-}
-
template<int size, bool big_endian>
void
Sized_pluginobj<size, big_endian>::do_add_symbols(Symbol_table* symtab,
+ Read_symbols_data*,
Layout* layout)
{
const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
gold_unreachable();
}
-// Class Add_plugin_symbols.
-
-Add_plugin_symbols::~Add_plugin_symbols()
-{
- if (this->this_blocker_ != NULL)
- delete this->this_blocker_;
- // next_blocker_ is deleted by the task associated with the next
- // input file.
-}
-
-// We are blocked by this_blocker_. We block next_blocker_. We also
-// lock the file.
-
-Task_token*
-Add_plugin_symbols::is_runnable()
-{
- if (this->this_blocker_ != NULL && this->this_blocker_->is_blocked())
- return this->this_blocker_;
- if (this->obj_->is_locked())
- return this->obj_->token();
- return NULL;
-}
-
-void
-Add_plugin_symbols::locks(Task_locker* tl)
-{
- tl->add(this, this->next_blocker_);
- tl->add(this, this->obj_->token());
-}
-
-// Add the symbols in the object to the symbol table.
-
-void
-Add_plugin_symbols::run(Workqueue*)
-{
- this->obj_->add_symbols(this->symtab_, this->layout_);
-}
-
// Class Plugin_finish. This task runs after all replacement files have
-// been added. It calls Layout::layout for any deferred sections and
-// calls each plugin's cleanup handler.
+// been added. It calls each plugin's cleanup handler.
class Plugin_finish : public Task
{
{
Plugin_manager* plugins = parameters->options().plugins();
gold_assert(plugins != NULL);
- plugins->layout_deferred_objects();
plugins->cleanup();
}