#include "script.h"
#include "readsyms.h"
#include "plugin.h"
+#include "layout.h"
+#include "incremental.h"
namespace gold
{
{
bool is_thin_archive
= memcmp(ehdr, Archive::armagt, Archive::sarmag) == 0;
- if (is_thin_archive
+ if (is_thin_archive
|| memcmp(ehdr, Archive::armag, Archive::sarmag) == 0)
{
// This is an archive.
input_file, is_thin_archive,
this->dirpath_, this);
arch->setup();
-
+
+ if (this->layout_->incremental_inputs())
+ {
+ const Input_argument* ia = this->input_argument_;
+ this->layout_->incremental_inputs()->report_archive(ia, arch);
+ }
+
// Unlock the archive so it can be used in the next task.
arch->unlock(this);
{
// This is an ELF object.
- bool unconfigured;
+ bool unconfigured = false;
+ bool* punconfigured = (input_file->will_search_for()
+ ? &unconfigured
+ : NULL);
Object* obj = make_elf_object(input_file->filename(),
input_file, 0, ehdr, read_size,
- &unconfigured);
+ punconfigured);
if (obj == NULL)
{
- if (unconfigured && input_file->will_search_for())
+ if (unconfigured)
{
Read_symbols::incompatible_warning(this->input_argument_,
input_file);
Read_symbols_data* sd = new Read_symbols_data;
obj->read_symbols(sd);
+ if (this->layout_->incremental_inputs())
+ {
+ const Input_argument* ia = this->input_argument_;
+ this->layout_->incremental_inputs()->report_object(ia, obj);
+ }
+
// Opening the file locked it, so now we need to unlock it. We
// need to unlock it before queuing the Add_symbols task,
// because the workqueue doesn't know about our lock on the
std::string ret("Read_symbols ");
if (this->input_argument_->file().is_lib())
ret += "-l";
+ else if (this->input_argument_->file().is_searched_file())
+ ret += "-l:";
ret += this->input_argument_->file().name();
return ret;
}
// Add the symbols in the object to the symbol table.
void
-Add_symbols::run(Workqueue* workqueue)
+Add_symbols::run(Workqueue*)
{
Pluginobj* pluginobj = this->object_->pluginobj();
if (pluginobj != NULL)
return;
}
- // If this file has an incompatible format, try for another file
- // with the same name.
- if (this->object_->searched_for()
- && !parameters->is_compatible_target(this->object_->target()))
- {
- Read_symbols::incompatible_warning(this->input_argument_,
- this->object_->input_file());
- Read_symbols::requeue(workqueue, this->input_objects_, this->symtab_,
- this->layout_, this->dirpath_, this->dirindex_,
- this->mapfile_, this->input_argument_,
- this->input_group_, this->next_blocker_);
- this->object_->release();
- delete this->object_;
- }
- else if (!this->input_objects_->add_object(this->object_))
+ if (!this->input_objects_->add_object(this->object_))
{
this->object_->release();
delete this->object_;
std::string ret("Read_script ");
if (this->input_argument_->file().is_lib())
ret += "-l";
+ else if (this->input_argument_->file().is_searched_file())
+ ret += "-l:";
ret += this->input_argument_->file().name();
return ret;
}