aboutsummaryrefslogtreecommitdiff
path: root/gold/archive.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-06-02 20:13:23 +0000
committerCary Coutant <ccoutant@google.com>2011-06-02 20:13:23 +0000
commit7cdb37d9aa10a7e988a3812304da6b04dc2fd4c1 (patch)
tree30af4c568ba363cbb07f0ef04145f7f7dc2d7a1b /gold/archive.cc
parent8dfd1e6d6ee42d903a027e42670ef8d3553678c3 (diff)
downloadgdb-7cdb37d9aa10a7e988a3812304da6b04dc2fd4c1.zip
gdb-7cdb37d9aa10a7e988a3812304da6b04dc2fd4c1.tar.gz
gdb-7cdb37d9aa10a7e988a3812304da6b04dc2fd4c1.tar.bz2
PR gold/12163
* gold/archive.cc (Archive::Archive): Initialize new data member. (Archive::include_all_members): Return if archive has already been included. * gold/archive.h (Archive::include_all_members_): New data member.
Diffstat (limited to 'gold/archive.cc')
-rw-r--r--gold/archive.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/gold/archive.cc b/gold/archive.cc
index a7a5b93..c3f7b94 100644
--- a/gold/archive.cc
+++ b/gold/archive.cc
@@ -179,7 +179,8 @@ Archive::Archive(const std::string& name, Input_file* input_file,
: Library_base(task), name_(name), input_file_(input_file), armap_(),
armap_names_(), extended_names_(), armap_checked_(), seen_offsets_(),
members_(), is_thin_archive_(is_thin_archive), included_member_(false),
- nested_archives_(), dirpath_(dirpath), num_members_(0)
+ nested_archives_(), dirpath_(dirpath), num_members_(0),
+ included_all_members_(false)
{
this->no_export_ =
parameters->options().check_excluded_libs(input_file->found_name());
@@ -847,6 +848,13 @@ bool
Archive::include_all_members(Symbol_table* symtab, Layout* layout,
Input_objects* input_objects, Mapfile* mapfile)
{
+ // Don't include the same archive twice. This can happen if
+ // --whole-archive is nested inside --start-group (PR gold/12163).
+ if (this->included_all_members_)
+ return true;
+
+ this->included_all_members_ = true;
+
input_objects->archive_start(this);
if (this->members_.size() > 0)