Don't emit symbols seen only in dynamic object, don't read duplicate

dynamic object.
This commit is contained in:
Ian Lance Taylor
2006-12-06 06:28:56 +00:00
parent 8f2e9323f0
commit 008db82ec1
8 changed files with 96 additions and 37 deletions

View File

@ -718,15 +718,29 @@ Sized_relobj<size, big_endian>::write_local_symbols(Output_file* of,
// Input_objects methods.
// Add a regular relocatable object to the list.
// Add a regular relocatable object to the list. Return false if this
// object should be ignored.
void
bool
Input_objects::add_object(Object* obj)
{
if (obj->is_dynamic())
this->dynobj_list_.push_back(static_cast<Dynobj*>(obj));
else
if (!obj->is_dynamic())
this->relobj_list_.push_back(static_cast<Relobj*>(obj));
else
{
// See if this is a duplicate SONAME.
Dynobj* dynobj = static_cast<Dynobj*>(obj);
std::pair<Unordered_set<std::string>::iterator, bool> ins =
this->sonames_.insert(dynobj->soname());
if (!ins.second)
{
// We have already seen a dynamic object with this soname.
return false;
}
this->dynobj_list_.push_back(dynobj);
}
Target* target = obj->target();
if (this->target_ == NULL)
@ -737,6 +751,8 @@ Input_objects::add_object(Object* obj)
program_name, obj->name().c_str());
gold_exit(false);
}
return true;
}
// Relocate_info methods.